git add --resolved stages conflict fixes without the rest
Git 2.56 adds an add mode that stages only unmerged paths and refuses files that still contain conflict markers.
Finishing a conflicted merge has two steps: edit the working tree, then stage the resolved paths. git add --resolved, highlighted in GitHub’s Git 2.56 overview, does the staging step safely: it considers only paths that are unmerged in the index, and it scans them for leftover conflict markers before staging anything.
Note
Tested with Git 2.56.0 on macOS on 2026-09-30.
Usage
Start from a merge that conflicts in recipe.txt, with an unrelated local edit in notes.txt, and recipe.txt not yet resolved:
$ git status --short
M notes.txt
UU recipe.txt
git add --resolved scans the unmerged path before staging. Because recipe.txt still contains conflict markers, it stages nothing:
$ git add --resolved
fatal: the following paths still have conflict markers:
recipe.txt
After I edit recipe.txt to the final content and run it again, the resolution is staged and the unrelated edit stays unstaged:
$ git add --resolved
$ git status --short
M notes.txt
M recipe.txt
The two status columns show the difference: recipe.txt has M in the staged column, notes.txt only in the unstaged one.
A pathspec limits which unmerged paths are considered. The marker check is all-or-nothing within the selection. Resolved deletions and binary conflicts have no markers, so they stage normally. The mode ignores tracked files that were never conflicted, and it cannot be combined with -u or -A.
I added it to my dotfiles as a two-letter alias, next to my other short aliases:
# .gitconfig
[alias]
# Stage resolved conflicts only; refuses leftover conflict markers (Git 2.56).
ar = add --resolved
Notes
git add -u was the usual shortcut here, and it has two failure modes this fixes: it stages every modified tracked path, including local changes unrelated to the conflict, and it happily stages files that still contain markers I overlooked. The first matters in maintainer merges that start with unrelated local changes present.
References
- git-add documentation: official reference for
--resolved - Highlights from Git 2.56: where I learned about the feature
This post was written with AI assistance.