1

Given I have two branches master and BranchA. BranchA came off master.

I was on BranchA and did a git pull and it was successful. I then did a git fetch followed by git merge origin/master.

It then stated that the Merge made by the 'recursive' strategy and was successful.

When I tried to do git push I got a warning and stated the remote contains work I did not have locally. After doing a git pull again I can see git apply commits that look to be part of my merge of master.

My query is that my merge did not show as a merge commit but seems to show each of the commits that were in master but not in BranchA at the time of merging. Why would this occur?

Michael Kemmerzell
  • 4,802
  • 4
  • 27
  • 43
eVolve
  • 1,340
  • 1
  • 11
  • 30
  • 1
    Somebody changed the remote? Have a look at git log --all – Christoph Jan 30 '20 at 12:56
  • Was it a fast-forward merge? https://stackoverflow.com/questions/29673869/what-is-git-fast-forwarding – mkrieger1 Jan 30 '20 at 12:58
  • Yeah someone had changed remote of BranchA but why would the merge commit no longer show and the branch now shows all the new commits from master as if they had been applied on BranchA rather than just a single merge commit – eVolve Jan 30 '20 at 14:38
  • There's not enough information in your question to be sure, but it seems likely that someone else did a non-merge operation with the *other* Git repository you're using here, that resulted in replacing some original commits with new (and presumably improved) copies. Your Git still has the originals and has combined those originals with their new-and-improved copies, so that you have TWO sets of commits, instead of just the originals or just the copies. – torek Jan 30 '20 at 19:31
  • This—the combining of the original copies that someone else had *intended* to replace, and did successfully replace in their Git, with the originals that you have in your Git—is the primary reason people *should not* do this "replace commits with new and improved ones" *unless* everyone, including you, have agreed in advance that all people working with clones of these repositories are prepared to have this happen, and know what to do about it. – torek Jan 30 '20 at 19:32

0 Answers0