MergeGlassDiff clearly. Merge confidently.

Merge workflow guide

How to resolve Git merge conflicts without guessing

A conflict is not Git failing. It is Git asking a human to decide how competing edits should fit together. This workflow keeps that decision small, reviewable, and testable.

Table of contents

Understand what Git is showing you

Conflict markers divide the current side, the incoming side, and sometimes their common base. The labels depend on the command and tool, so confirm which branch or commit each side represents before editing.

Git marks a conflict when it cannot combine overlapping changes safely. The correct result may be one side, both sides in a deliberate order, or a new implementation that appears in neither version.

Resolve in a controlled sequence

Start from intent. Read commit messages, tests, and issue context first. Then remove marker syntax only after deciding the desired behavior.

Review imports, types, names, delimiters, and callers after the conflict body is resolved. Search for remaining marker strings before staging.

Validate the merge as a change

Run formatting, linting, typechecking, build, and the most relevant tests. A syntactically clean merge can still drop behavior.

Review staged output with `git diff --staged` and write down non-obvious decisions in commit or pull-request notes.

Worked example: resolve intent rather than deleting markers

Suppose the current branch keeps a five-second timeout while the incoming branch raises it to eight seconds. Git cannot choose your service policy. Removing the markers while keeping both declarations would produce duplicate constants; selecting a side without context could discard the intended fix.

This example assumes a normal merge. During a rebase, the meaning of ours and theirs can be surprising because Git is replaying commits onto another base. Inspect commit names and the actual file contents rather than treating left and right as universal branch labels.

Unresolved settings.mjs

<<<<<<< HEAD
export const timeoutMs = 5000;
=======
export const timeoutMs = 8000;
>>>>>>> feature/timeout
The marker labels identify the two conflicting versions in this normal merge.

Resolved candidate

export const timeoutMs = 8000;
Use this result only after confirming the incoming timeout change is intended. Exactly one declaration remains.

Use the common ancestor when you have it

For an unresolved path, Git can expose stage 1 (base), stage 2 (ours), and stage 3 (theirs) through git show :1:path, git show :2:path, and git show :3:path. Some conflict types do not have every stage; inspect git status first. Work on copies so you do not accidentally overwrite the working-tree file.

In MergeGlass, load the two versions into A and B. If you have their common ancestor, select Three-way and supply that base. Review the overlapping block and choose the intended timeout. Export the candidate back to the actual conflicted path in your checkout; the browser tool does not stage files or continue Git for you.

If the correct answer combines logic from both sides, make that edit deliberately. Keep both concatenates blocks; it does not understand variable declarations, object keys, or application behavior. Inspect the whole output before replacing the working-tree file.

Finish the merge and know when to stop

Run git diff --check to catch whitespace errors and leftover conflict markers in the diff, inspect git status, and run the relevant tests. For the sample, import the resolved module and check that timeoutMs equals 8000. Then stage the resolved file, inspect git diff --staged, and use git merge --continue for the normal merge.

If you are rebasing or cherry-picking, use that operation’s continue command instead. Do not start a second merge to escape an unfinished operation. If the context is wrong, inspect status and use the matching abort command; start with a clean working tree so pre-existing edits are not mixed into recovery.

A resolved file is only one part of completion. Check callers, related configuration, generated artifacts, and lockfile policy. When the result is unclear, get the change owner’s intent before finalizing rather than choosing whichever side makes the marker disappear.

Try it yourself

Resolve one conflict with a common base

Both sides changed timeoutMs. For this fictional requirement, keep B’s 10000ms timeout and its independent retries change. This practice compares file contents; it does not run Git.

Try this example adds fictional sample data as a separate file review and keeps your existing reviews.

The download is a standalone practice session. Save your current work before importing it through Add or import → Import review bundle. Your own content is never included in the download.

Command checklist

  • git status
  • git diff
  • git diff --staged
  • git add <resolved-file>
  • git merge --continue

Review checklist

  • Identify current, incoming, and common-base versions.
  • Read the reason behind both edits.
  • Choose A, B, both, or a new combined implementation.
  • Remove every conflict marker.
  • Review the staged diff.
  • Format, lint, build, and test.