Team FAQ: this question comes up often, so we've answered it below. Add your own experience, or a different view, in the comments.
You run git merge or git pull and Git says "CONFLICT (content): Merge conflict in ...". What now?
Team FAQ: this question comes up often, so we've answered it below. Add your own experience, or a different view, in the comments.
You run git merge or git pull and Git says "CONFLICT (content): Merge conflict in ...". What now?
A conflict just means two branches changed the same lines, and Git wants you to choose. Nothing is lost.
Step by step:
git statusto see which files are conflicted ("both modified").The top part is your current branch; the bottom part is the branch you're merging in.
git add path/to/file git commit # for a merge # or: git rebase --continue (if you were rebasing)Changed your mind?
git merge --abort(orgit rebase --abort) puts everything back to how it was before.Tips:
mainoften.Got a tip that makes conflicts easier? Add it below.