Skip to content
Discussion options

You must be logged in to vote

1️⃣ What is a Merge Conflict?

A merge conflict happens when Git tries to merge two branches, but finds changes in the same part of a file that it cannot automatically resolve.

  • Example:
    You and your teammate both edit index.html at the same line. Git doesn’t know whose change to keep → merge conflict occurs.

  • How to fix:

    1. Open the conflicted file.
    2. Look for Git markers:
      <<<<<<< HEAD
      Your changes
      =======
      Teammate’s changes
      >>>>>>> branch-name
      
    3. Decide which version to keep (or combine both).
    4. Save the file, then:
      git add filename
      git commit -m "Resolve merge conflict"

💡 Tip: Merge conflicts are normal in teamwork. Communicate and review carefully before resolving.


2️⃣ Difference Betwe…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by sanjay-kv
Comment options

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