Git 2.56: git add --resolved, branch cleanup, and the features worth learning
Git 2.56 adds git add --resolved for safer conflict fixes, git branch --delete-merged for bulk cleanup, git history drop, and a much faster merge-base. What each does, with the exact commands.
You fix a merge conflict. You run git add -u to stage the fix. Then you run git commit, and the build breaks. Two things went wrong. One file still had a <<<<<<< line you missed. And git add -u also staged an unrelated edit you were not ready to commit.
Git 2.56 adds a command made for exactly this moment. It is the most useful change in the release, so this post starts there.
Git 2.56 was released on 28 September 2026, with work from more than 100 contributors, 39 of them new. The current point release is 2.56.1, which changes nothing in the features below. As usual, much of the release is speed you get for free. But a few changes are commands you will type yourself, and those are what this post covers.
Everything below is checked against the official Git 2.56 release notes, the Git manual pages, and GitHub's highlights post. Two of the commands here (git history and git replay) are marked experimental in the manual. Their behaviour may still change, so check the docs before you build scripts on them.
1. git add --resolved: stage only what you actually fixed
When a merge or rebase stops on a conflict, Git marks some files as unmerged. Your job is to edit each one, remove the conflict markers, and stage it. If you have not seen this before, How to resolve merge conflicts in Git walks through the whole loop.
The staging step was the weak point. You had two common choices:
git add <file>for each file, one by one. Safe, but slow when there are many files.git add -uto stage every changed tracked file at once. Fast, but it stages everything, including edits that have nothing to do with the conflict. It also stages a file that still contains conflict markers, without any warning.
Git 2.56 adds a third choice:
git add --resolved
The manual describes it in three rules:
- It only looks at unmerged paths. Your other edits are left alone.
- It checks each of those files for leftover conflict markers.
- If any file still has markers, it stages nothing and tells you which files to fix.
Here is how it looks in practice, adapted from GitHub's example:
$ git add --resolved
fatal: the following paths still have conflict markers:
recipe.txt
# open recipe.txt, remove the markers, save
$ git add --resolved
$ git status --short
M notes.txt
M recipe.txt
Look at the last two lines. recipe.txt was the conflicted file, and it is now staged (the M is in the first column). notes.txt was an unrelated edit. It stays unstaged (the M is in the second column), so it will not sneak into the merge commit.
A few details worth knowing:
- You can limit it to some files:
git add --resolved src/. The marker check is all-or-nothing across whatever you select. - Binary files and deleted files have no markers to check. If they are unmerged, they are staged as resolved.
- You cannot combine it with
-uor-A. That is on purpose, because those flags stage more than the conflict.
When to use it: any time a merge, rebase, cherry-pick, or git stash pop stops on a conflict. It replaces the "stage, then hope" step with "stage, but only if it is really done." If you have ever seen error: you need to resolve your current index first, this is the habit that makes it rarer.
2. git branch --delete-merged: clean up old branches in one command
After a few months, git branch turns into a long list of old work. Most of it is already on the remote. Until now, cleaning it up meant a shell loop, or deleting branches one at a time with git branch -d.
Git 2.56 adds a built-in option. Start with a dry run:
git branch --dry-run --delete-merged origin
This prints the branches Git would delete, and changes nothing. If the list looks right, run it again without --dry-run.
The exact rule matters here, so read it carefully. From the git-branch manual, a local branch is deleted when both of these are true:
- Its configured upstream matches the pattern you give. The pattern can be a ref (
origin/main), a remote name (origin, which means the branchorigin/HEADpoints at), or a glob ('origin/*'). - Its tip is reachable from that upstream. In plain words: every commit on the branch is already in the branch it tracks.
You can also limit which local branches are considered, by adding branch-name patterns after it:
git branch --dry-run --delete-merged 'origin/*' 'feature/*'
Notice what "merged" means here: merged into the branch's upstream, the branch it tracks. That makes the command more careful, and more limited, than its name suggests. We tested it on Git 2.56.1 with four branches:
| Local branch | Tracks | State | Deleted? |
|---|---|---|---|
feature/onmain | origin/main | merged into main with git merge | Yes |
feature/pushed | origin/feature/pushed | fully pushed | No |
feature/squashed | origin/main | squash-merged into main | No |
feature/unpushed | origin/main | has a commit not in main | No |
Two of those results surprise people:
- A branch that tracks its own remote copy is skipped. Most feature branches are pushed with
git push -u origin feature/x, so they trackorigin/feature/x. Pushing such a branch would update its own upstream, so Git cannot tell "fully merged" apart from "fully pushed." The manual says Git skips these branches on purpose. The command only cleans up branches whose upstream is a different branch, such asorigin/main. You get that setup when you create a branch withgit switch -c feature/x origin/main. - Rewritten commits are not detected. A squash merge puts one new commit on
main. GitHub's "rebase and merge" also creates new commits. Either way, your original commits are not inmain's history, so Git keeps the branch. This is the same reachability rulegit branch -duses. The Squash Merge lesson shows why.
Git also skips a branch when:
- it is checked out in any worktree
- its upstream no longer exists
- another branch that is not being deleted uses it as an upstream
- it has work that is not yet in its upstream (skipped silently)
To protect one branch from bulk cleanup forever, set:
git config branch.my-long-topic.deleteMerged false
A normal git branch -d my-long-topic still works on it.
If you delete a branch by mistake, its commits are usually still recoverable for a while. Recover a deleted Git branch shows the exact steps.
3. git history drop: remove one commit from your branch
Git 2.54 and 2.55 added the experimental git history command, with reword, split, and fixup. (The Git 2.55 post covers fixup.) Git 2.56 adds drop:
git history drop <commit>
It removes that commit and replays every later commit onto its parent. Before, you would open git rebase -i, find the line, change pick to drop, save, and close the editor. Now it is one command. Use --dry-run first to see what would change.
By default it also moves other local branches that were built on top of the dropped commit, the same way git rebase --update-refs does. (See Rebase stacked branches in one shot for why that matters.) Use --update-refs=head to rewrite only the current branch.
The limits, from the git-history manual:
- It cannot drop the root commit or a merge commit.
- It does not work on history that contains merges. Use
git rebase --rebase-mergesfor that. - If replaying a later commit would cause a conflict, it stops with an error and changes nothing. This is by design. It never leaves you half-way through a rewrite.
- If it would overwrite uncommitted changes, it stops before touching anything.
One reminder that applies to every history rewrite: only do this on commits you have not shared yet. Dropping a commit gives every later commit a new ID, and anyone who pulled the old ones will have to deal with that.
4. git bisect run --reset-when-found: finish the search in one step
git bisect run lets Git find the commit that broke something, by running a test script on each step of a binary search. When it finds the culprit, you used to run git bisect reset yourself to clean up.
Now you can ask Git to do that for you:
git bisect start HEAD v2.1.0
git bisect run --reset-when-found ./test.sh
The git-bisect manual lists two choices:
| Option | What happens after the bad commit is found |
|---|---|
--reset-when-found (or =original) | Reports the commit, then returns you to where you started |
--reset-when-found=found | Reports the commit, then leaves it checked out |
Use =found when you want to look at the broken commit right away. It does not work with a bisect started with --no-checkout. The Automated Bisect lesson lets you try git bisect run on a real repository.
5. Typo hints for the push mistake everyone makes
This one is small, but it will help a lot of people. Type a slash where Git expects a space:
git push origin/main
This fails, because Git reads origin/main as the place to push to. In Git 2.56, the error now tells you what you almost certainly meant:
fatal: 'origin/main' is not a valid push target
hint: Did you mean to use: git push origin main?
Git checks that the suggestion makes sense before it shows it. If the hint gets in your way, git config set advice.pushRepoLooksLikeRef false turns it off.
The difference is simple once you see it. origin main is two words: a remote and a branch. origin/main is one name: your local copy of the remote's branch. The Upstream & Tracking Branches lesson explains when you need each.
The smaller changes
git log --graphindents unrelated root commits. Before, a commit with no parents could appear right below an unrelated commit and look connected. Git now indents it. Use--no-graph-indentor thelog.graphIndentsetting for the old look.git log --followhandles renames across merges better. It now tracks the path separately for each parent, so the result no longer depends on the order Git walks history.git statusexplains how to catch up. When your branch is behind or has diverged, the advice now suggestsgit pull <remote> <branch>.git branch -dexplains itself during a bisect. If a branch is in use by an active bisect, Git now says so.git worktree add -brespects your choice. An explicit-bor-Bis no longer overridden by Git guessing a remote-tracking branch.-hand--helpexit with code 0. They used to exit with 129, which made scripts think help was an error.git refscan now change refs. Newcreate,update,delete, andrenamesubcommands, with optional old values for safe compare-and-swap. These are low-level tools for scripts. For everyday work,git branch -mis still the right way to rename a branch, becausegit refs renamedoes not update branch config.- Experimental
git replay --linearizedrops merge commits while replaying, likegit rebase --no-rebase-merges, without touching your working tree. - Partial clones can drop large blobs again.
git repack -a --filter=blob:limit=1m --drop-filtereddeletes large local blobs that can be fetched again from the server later. Run it with--dry-runfirst.
Under the hood: faster on big repositories
You do not need to change anything to get these.
- Much faster merge-base. Git now stops walking history once no new merge base can be found. GitHub reports that on the Linux kernel,
git merge-base --all v4.8 v4.9dropped from 167,441 steps (0.29 s) to 3,887 steps (0.01 s). On one large monorepo it was about 70 times faster. Commands likegit mergeandgit rebaseneed the merge base before they can start, so they benefit too. git statusscales better. Listing untracked and ignored files went from quadratic time to O(n log n), per the release notes. This matters most in folders with many untracked files.- A huge
git diffspeedup in one case. Fixing a quadratic slowdown took onegit diffon a Chromium checkout (about 500,000 index entries) from roughly eight minutes to 0.07 s. - Smaller packs for hosts. The
--path-walkrepack mode now works with reachability bitmaps and delta islands. In GitHub's test on a Fluent UI clone, the pack shrank from 558.5 MB to 164.4 MB. It is not on by default.
Treat these numbers as best cases measured on very large repositories. On a small project you will not notice most of them.
Common myths about this release
Myth 1: "--delete-merged deletes branches that were merged into main." It deletes branches whose commits are already in their upstream. For a branch that tracks origin/main, that matches "merged into main." But a feature branch that tracks its own remote copy (origin/feature/x) is skipped, and so is any branch merged by squash or by GitHub's rebase-and-merge. If your team works that way, the command may find little to delete. Read the --dry-run list before you delete anything.
Myth 2: "git add --resolved resolves the conflict for me." It does not edit any file. You still choose which side wins and remove the markers. The command only checks your work and stages it. Think of it as a safety check on git add, not a merge tool.
Myth 3: "Experimental means broken." In Git, experimental means the interface may still change: option names, defaults, output. It does not mean the command is careless with your data. git history drop stops on conflicts by design and changes nothing when it does. The real advice is narrower: use these commands by hand, but do not depend on their exact output in scripts yet.
How to get it
Check your version:
git --version
If it is below 2.56.0, upgrade through your package manager (brew upgrade git, apt, winget, and so on) or from git-scm.com/downloads. Linux distributions often ship older Git versions, so your distribution may need a few weeks to catch up.
What to try this week
git add --resolved. Use it the next time a merge or rebase stops. It costs nothing and catches the most common conflict mistake.git branch --dry-run --delete-merged origin. Run the dry run once to see what it would remove. If the list is short, your branches probably track their own remote copies, and section 2 explains why those are skipped. Read the list before you delete anything.
What to read next
- How to resolve merge conflicts in Git: the full conflict loop that
git add --resolvedmakes safer. - Recover a deleted Git branch: your undo button if a bulk cleanup removes a branch you still needed.
- Git 2.55: the new features you will actually use: the previous release, including
git history fixup. - Git reflog: the undo button: why rewriting or deleting in Git is rarely final.
- Git 3.0: what is changing: the next major version, and what to check before it arrives.
Want to practise before you need it? The merge conflict scenario gives you a real conflict in a live terminal, with no real repository at risk.