0

I'm looking into my Git commit log and I see an odd repository state, where there are two origins after a merge:

  • 4bbc006 (HEAD, origin/XXX, master) Hierarchical modular cluster similarity
  • 4a9cf4b (origin/master) Added PCA labels for folder management

I would think that XXX will be removed after the following sequence of events: - branching from the origin/master to 'XXX' and modifying code - commit and push to XXX - checking out master, merging and deleting XXX branch

So what's going on and how can I have all the pointers pointing to my merged final version of the project?

Thanks

A Magen
  • 3
  • 1
  • 1
    Possible duplicate of [How do I delete a Git branch both locally and remotely?](https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-both-locally-and-remotely) – jrtapsell Jun 04 '18 at 23:56
  • If you want origin/master to be at bbc006, you need to push that branch. Pushing to to branch XXX on a remote will not modify master on that remote. – William Pursell Jun 05 '18 at 00:00

1 Answers1

0

XXX has been removed, and you no longer have that branch locally. There is only one remote (origin) with two branches (origin/master and origin/XXX). You pushed to origin/XXX which moved it forward. You then checked out master and merged it, and given that you didn't subsequently push to origin/XXX we can see that it was a fast-forward merge, so that master now references the same commit as origin/XXX. But you haven't pushed origin/master, so it's still where it was. If you want to move origin/master forward, you should push master. (Assuming that master is tracking origin/master.)

Think of it this way--in total, you have 4 branches: master, XXX, origin/master, and origin/XXX. You first moved XXX by making a commit. Then you moved origin/XXX by pushing. Then you checked out master and did a merge to move it forward. Then you deleted XXX. But you haven't touched origin/master, so it's still where you left it.

William Pursell
  • 204,365
  • 48
  • 270
  • 300