It is found that conflicts sometimes occur when executing git rebase -i HEAD~10
. Currently, a conflict is found. As follows:
Create b1 and b2 branches from the master branch, and both branches modify the same location. Conflicts occur when merge b1, b2, and merge b2 on the master branch. The conflicts are resolved and a merge commit is generated. At this time git rebase -i HEAD~10
there will be a problem:
The two commits of b1 and b2 will conflict
I didn’t see merge commit when rebase -i
The conflict was obviously resolved in the merge commit. Why is there still a conflict and the merge commit is gone?
How to resolve conflicts correctly? Obviously I want to get the results in the merge commit. Or what kind of workflow can avoid conflicts?
After manually correcting the conflicting files
git add
/git commit
No matter what workflow you use, as long as two people are likely to modify the same file at the same time, you cannot avoid merge conflicts, so you must start by dividing the work.