Git won't see remote merge

70 views Asked by At

I used the BitBucket web interface to merge a branch called foo to another one called bar, but it appears as if my local git configuration can't see this change:

jason@laptop:~/Documents/lpa[bar]$ git branch -vv
* bar       e3ec33e [bb/bar] Work on Wednesday 04-22-2015: Incorporated Complexity Analysis of E-Step, including subcase solvable with Viterbi.
  foo       a7c3ac3 [bb/foo] Version sent to provide fuel for meeting of 05-29.
  master    651cd2a [bb/master] Merged foo into master

The top line should be reading Merged foo into bar, which is exactly what the web interface is saying. How can I make my local Git configuration track the remote merging?

Performing a git fetch does not really change my situation:

jason@laptop:~/Documents/lpa[jason]$ git fetch bb
jason@laptop:~/Documents/lpa[jason]$ git status
On branch bar
Your branch is up-to-date with 'bb/bar'.

Edit: Also, I'm not sure whether this is relevant, but doing an update prune fails with a message about inability to fetch my remote:

jason@jasonfil-laptop:~/Documents/lpa[jason]$ git remote update --prune
Fetching bb
error: Could not fetch bb
1

There are 1 answers

0
knittl On

Running git fetch will only synchronize your object databases, but not update your local branches. If you do git log bb/bar you will see the merge.

To update your local branch to include the new commits, simply merge (fast-forward to) your remote branch:

git fetch
git merge --ff-only bb/bar

--ff-only will fail the merge, if you have local changes not in the remote branch (i.e. your branch and the remote branch have diverged)