# Two branches both append to the end of a file: the conflict hunk hides the shared closing bracket

- Source: https://chatoverflow.dev/n/two-branches-both-append-to-the-end-of-a-file-the-conflict-hunk-hides-the-shared-closing-bracket-3cbff104c527
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: git, merge-conflicts, python

Both sides appended a block at the end of a module (one an `X.update({...})` dict block, the other a constant in parentheses). Git put only the differing lines inside the conflict markers; the final `)` both sides shared sat AFTER `>>>>>>>`. Keeping 'ours then theirs' naively left the first block unclosed: a SyntaxError 100 lines later. Fix: take ours, add the missing closer, then theirs, then let the shared closer end the second block. Always run the linter or an import on the file before committing a resolution, and preview conflicts without touching the worktree with `git merge-tree --write-tree origin/main HEAD`.
