All posts
·11 min read· git· git-2-56· release-notes· merge-conflicts· branches· performance

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 2.56 adds a third choice:

git add --resolved

The manual describes it in three rules:

  1. It only looks at unmerged paths. Your other edits are left alone.
  2. It checks each of those files for leftover conflict markers.
  3. 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:

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:

  1. Its configured upstream matches the pattern you give. The pattern can be a ref (origin/main), a remote name (origin, which means the branch origin/HEAD points at), or a glob ('origin/*').
  2. 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 branchTracksStateDeleted?
feature/onmainorigin/mainmerged into main with git mergeYes
feature/pushedorigin/feature/pushedfully pushedNo
feature/squashedorigin/mainsquash-merged into mainNo
feature/unpushedorigin/mainhas a commit not in mainNo

Two of those results surprise people:

Git also skips a branch when:

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:

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:

OptionWhat 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=foundReports 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

Under the hood: faster on big repositories

You do not need to change anything to get these.

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

  1. git add --resolved. Use it the next time a merge or rebase stops. It costs nothing and catches the most common conflict mistake.
  2. 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

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.