Merge a branch in git with conflicts (via the command-line)

by krishnanm
macOS ◆ xterm ◆ bash 359 views

When git detects conflicts that it cannot resolve automatically (such as unrelated changes), the merge will not complete automatically

git will display the files that have merge conflicts with conflict markers that demarcate the content and the branch that the content was on. The user can then edit the files and decide on resolving the conflicts, by retaining one or more changes or making other changes altogether.

When done, stage all such files for inclusion (via “git add”) and continue with “git commit”. git knows that a merge was in progress and will provide an appropriate message that you may choose to edit