I wanted to fetch a single remote branch and then rebase my current working branch against that as I am sharing it with someone. Usually I would just do:
git fetch
git rebase origin/branch_im_working_on
That seems to work ok but it appears to fetch all branches from the remote repository. So I looked around and found this:
git fetch origin branch_im_working_on
When I do this git tells me it fetched HEAD and then try to do:
git rebase origin/branch_im_working_on
git tells me that I am up to date and there is nothing to do even though I know there are changes pushed to remote.
If I try to do:
git rebase origin branch_im_working_on
I get a lot of merge conflicts so had to resort back to the original commands to get my branch up to date:
git fetch
git rebase origin\branch_im_working_on
Can someone help me understand what is happening here?
git rebase origin\branch_im_working_onwill rebase your local with its counterpart on origin. SO if both are in sync then there is nothing to do. Are you sure that fetch happened successfully? And that the origin version is head of yours?origin, you shouldn't have any problems, you can check it withgit remote -v. That will list the remotes you have. Also you can check what you fetched, by looking at the log oforigin/your_branchgit fetch origin <branch> && git rebase FETCH_HEAD.FETCH_HEADshould be the same asrefs/remotes/origin/his_branch/HEADright?