Git checkout remote bare repo to an older branch
I'm currently testing out deploying websites via Git and am having trouble understanding the following:
Currently, I have a bare remote repo on my DEV environment with a post-receive hook which sets GIT_WORK_TREE to my webroot. I push to there from my local repo with syntax like 'git push DEV master'. This works great. However, I also have a 'develop' branch which I push to DEV (the post-receive hook is set to 'git checkout -f [BRANCH_NAME]) and this also works great.
My question is for the following situation: let's say that I find a bug on DEV (pushed from 'develop' branch) but I don't have time to fix it (maybe there is a client review that day). I would love to be able to do a 'git push DEV master' (the master branch has the last bug-free push to DEV and is an ancestor of the develop commit currently on DEV) and be done with it. But, when I do this, the remote repo tells me 'Everything is up to date!' I suppose that makes sense, but what I would like to do is force git to take the push from 'master' branch and fire the post-receive hook anyway, which is necessary for proper deployment of web assets.
I tried going directly to the remote repo in ssh and attempting to checkout master from there, but it tells me I need a work tree to do this (because it's bare, I assume).
What is the correct method of doing this? I'd like to avoid doing a revert or rebase if possible, but maybe that's the only way.
I have ready many articles about protecting remote branches... I however would like to capture in a git hook the following LOCAL repo command: git branch -d abranchthatshouldnotbedeleted I would like
How can I push to a non-bare git repository, automatically add and commit any changes in the working tree, and then re-checkout the current branch to reflect the changes from that push? I was thinking
I am using Netbeans, and there is a feature call Push to Upstream. When I click it I get this message: No tracked remote branch specified for local master Is there a way to track the remote branch i
Possible duplicate: Getting existing git branches to track remote branches I know how to make a new branch that tracks remote branches. But how do I make an existing branch track a remote branch. I k
I'm a git noob so this might look like a silly question. I have local & remote git repositories. I want to sync my local repository with remote repository so that my local repository becomes 100%
ON A SERVER I created a git repo in the working directory of my web-app /html. To create a git 'host' repo, I ran git clone --bare html html.git. I now have a git 'host' repo and a git 'client' repo
I'm trying to use git submodules for aggregating 10+ repositories into one structure for easy development. It is supposed to clone the module and checkout a branch. Instead, the module is checked out
I have a branch called develop in remote bare repo hub and I have a checkout copy of the develop branch in my local git repository (user poomalai). I have deleted (git rm --cached) a file (Mydirec
I am looking for simple solution for my deployment bash script. Each run of this script should add tag to the latest revision on production branch, but of the remote repo. People running the script mi
Suppose that a remote repo remote has a branch spanking_new_branch that's not represented/referenced in any way in the local repository. I want to create a local branch that tracks remote/spanking_new
I have two branches, master and mybranch in a git repository. In a local folder cloned from the git repository before adding the second branch, I can only see the first branch, as expected: xxx$ git b
I have a directory on my PC I'd like to add to a particular branch in a remote git repo on my server. I have git, the branch was created fresh off the master from the server, but I've got an entire pr
I have a local repository that I want to mirror to the remote 'websrv'. This used to work fine until I deleted a local branch. Now when I do git push --mirror websrv I get remote: error: By default,
When I clone a remote repository with git clone 'repo_url' git pull git status I get this message - On branch master Your branch and 'origin/master' have diverged, and have 41 and 20 different comm
I have been sole developer, working on a project with a local repository under git. Now I need to create a bare repo for collaboration on a local network. How do I do that?
How can I retrieve the remote git address of a repo? I tried git remote but that just lists the branches.
What privileges or permissions do I need to set in a Git repo in order to create a remote branch? When I try to push my changes to the remote repo, I get this error: fatal: Upload denied for project
I have two repositories origin and fork. I cloned origin locally and added fork as a remote repository. I now created a new local branch, e.g.: git checkout master git branch new git checkout new I m
I cloned an existing svn repo off a remote server locally using git-svn's git svn clone <orig_svn_repo_path>. I now want to setup a remote repo for only a particular branch out of several branch
What is the all-in-one (or at least easier) way to accomplish this? Basically I want to create a branch but have it tracked so I can push changes, as a backup, to a central repo. git branch BranchName
The usual command is: git checkout origin/branch_i_want -b branch_i_want Git responds with: Branch branch_i_want setup to track remote branch branch_i_want from origin. This is fine. My question is
We have some devs pushing to a remote bare repo on a server, and would like to do something like automate a push to perforce nightly using git p4 from this central bare repo. But am running into a sna
I have to Git repos repo1 and repo2. There are three branches master, alpha and beta in repo1. repo2 clones from repo1. In repo2, I can see remote tracking branches with git branch -a: remotes/origin/
I have set up some remote tracking branches in git, but I never seem to be able to merge them into the local branch once I have updated them with 'git fetch'. For example, suppose I have remote branch
I created a local branch by using git checkout -b mybranch Then I made certain changes to it and pushed to remote with git push origin mybranch However, I cannot see my local changes in the remote
I'm trying to use this post-recieve hook to update my live server GIT_WORK_TREE=/var/www/www.example.org git checkout -f This hook is on the remote bare repo and I would like the live work tree to be
Is it possible to delete a remote branch with hg-git? I can delete the tag locally (hg bm -d old-branch), but it's not obvious how to tell the git server to do the same.
I have a project locally that I pushed to github. Each time I am trying to push a commit to github it asks me for the remote url. Can't I configure it so that it will automatically push to my desired
What is a canonical sequence of git commands to get a local git checkout to precisely reflect the HEAD of a remote branch, with all files up-to-date, and nothing more in the checkout directory? Effect
I merged my local feature branch “navDrawer” into my copy of the remote “dev” branch. When I sync’d “dev”, it also created a remote “navDrawer” branch. Now I have 3 remotes (master, dev, navDrawer). H
I want to check a local branch currently tracking which remote branch For example: git checkout -b test_branch git branch --set-upstream test_branch origin/remote_project001 But after a few days, I
At my workplace we use SVN for version control. I switched to git-svn when I found out about it, and recently I decided to sync some of my private branches to another remote git repo. The workflow, th
Hey guys how would I checkout a specific branch from another remote address? Thanks
git-fetch manual page says: git fetch remote_repo will update remote-tracking branches of all branches from the remote repository. What if I only need fetch a single remote branch? I try to run: gi
There are some deletion happening at remote master branch, from where I have created this branch by using git checkout -b, but when I try to pull the changes of the remote branch by doing git checkout
I've taken the following steps so far: Cloned a remote Git repo Branched the master branch to an experimental edited/tested/committed code in the experimental branch Now, I'm not ready to merge expe
I set up a ssh key on the machine, cloned a branch on my local machine then tried to delete its associated branch on the remote. Below are my step. Delete the local branch using git branch -D abc-123
I just tried to do a force push to a remote branch like this: $> git checkout myBranch $> git rebase origin/master $> git push --force origin/myBranch fatal: 'origin/myBranch' does not appear
My git repo looks like this: _ branch_a / master / \_ branch_b Now I want to merge branch_b into branch_a, not either branch into master. So, I did git checkout branch_a git merge branch_b And git
In git, is it possible to merge the master of a fork to the main repo but only as a new branch? That way nothing really gets replaced and it's easier to go back since it's in a separate branch.
I find it confusing to that in git, to remove a remote you use 'remote rm'... git remote rm myremote ...while the syntax for deleting a branch requires the -d (or -D) switch: git branch -d mybranch
I've deleted a remote branch with the following command: git push le_remote :le_dead_branch And the branch was removed with success on the remote. But after checking the size of the git repo I found
This question already has an answer here: Merge, update, and pull Git branches without using checkouts 8 answers My remote git repo has two branches 'master' (for the next release) and 'maint'
This is what I'm doing.... how do I get rid of the origin remote branch? And what is it? [master] /dir: git status # On branch master nothing to commit (working directory clean) [master] /dir: git rem
I current have a bare repo thats acts as a central repo for my team. The bare repo currently only have a branch master. How can I create more branches on the bare repo?
Let's suppose I am on master branch and then I do : git branch new_branch git checkout new_branch touch newFile.txt When I do git checkout master to come back to my master branch, I expect I have a c
This is what the remote looks like. --C0--------------C4-- (master) \ --C1-C2-C3-- (lite_main) Actions I took: cloned the remote repo checked out lite_main made some changes and committed them Res
First, the big picture: I'm trying to write a git post-receive script for a Redmine / Gitolite server I'm running. As per various recommendations, I'm creating a bare and local repository for Redmine
I have a repo where my master has many commits... i want to create a new fresh branch from the first commit (the original code) so i do as follows: git checkout -b mybranch 4589D6a09505837ec03b where
I want to add a remote, and a branch of that remote. I did git remote add <newname> <url>, then I did git fetch --all but git branch -a is not showing any branch of the remote. My .git/con