शब्दकोश · प्रोग्रामिंग

Merge Conflict

A merge conflict happens when Git cannot automatically combine changes because two branches edited the same lines or one deleted a file the other changed.

अपडेट: अक्टूबर 6, 2026

A merge conflict occurs when Git is asked to combine two branches and cannot decide automatically which version of some lines to keep, typically because both branches changed the same lines or one deleted a file the other modified.

Why it matters

Conflicts are a normal part of team work, not a sign that something is broken. Git pauses the merge and marks the clashing sections so a human can decide. Resolving them correctly matters: choosing the wrong side or leaving markers in the file can introduce a bug or break the build.

Example

<<<<<<< HEAD
timeout = 30
=======
timeout = 60
>>>>>>> feature/longer-timeout

Everything between <<<<<<< and ======= is your current branch; the rest is the incoming branch. Edit the file to the final value, remove all three marker lines, then run git add and git commit.

Common mistakes

  • Committing the file with conflict markers still in it.
  • Accepting one side wholesale without reading what the other side changed.
  • Letting branches live for weeks, which makes conflicts larger; merge or rebase from main often.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.