Home > other >  a strange merge happened with my project when using git
a strange merge happened with my project when using git

Time:12-13

Today I found some of my project file conflict, but I did not merge any branch. I using the Intellij Idea show history, it looks like this:

enter image description here

what does this mean? it seems not merge forward but backward. why did this happen? what should I do to avoid this problem? from the git log command I did not found any merge operate.

CodePudding user response:

Since the commits are presented from most recent to oldest, the 2021/3/26, 10:44 commit is not a merge backward, but the point from which origin (violet) and develop (green) have diverged.

The commit from 24 minutes ago is where the two branches rejoined.
Display the parent commits of that "24 minutes" commit: you should see two parents.

It could be a merge --ours, where the content of your branch is preserved.

  •  Tags:  
  • git
  • Related