Skip to content
Discussion options

You must be logged in to vote

Merge conflicts happen when Git cannot automatically reconcile differences between two branches. Here are the step-by-step instructions to resolve them:

Step 1: Identify the conflicted files

When you run a merge command (like git merge feature-branch) and get a conflict, Git will output which files have conflicts. You can also run:

git status

Conflicted files will be listed under "Unmerged paths".

Step 2: Open and edit the conflicted files

Open the conflicted files in a code editor. You will see conflict markers injected by Git:

  • <<<<<<< HEAD (This marks the start of the changes from the current branch you are on, usually main)
  • ======= (This divides the changes)
  • >>>>>>> feature-branch (Th…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by monukodasseri-wq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants