]> git.ipfire.org Git - thirdparty/git.git/commit
branch: add --dry-run for --prune-merged
authorHarald Nordgren <haraldnordgren@gmail.com>
Wed, 3 Jun 2026 09:04:39 +0000 (09:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Jun 2026 10:10:05 +0000 (19:10 +0900)
commit972e17e2f43659280e5bf368f4f3f2ec7dfe110f
tree72bf2ba315cc32e4d57333c388c4475bfaa12aa8
parent3f148f0eb1f24cb110ba441149b8002e1ef20bbe
branch: add --dry-run for --prune-merged

With --dry-run, --prune-merged prints the local branches it would
delete, one "Would delete branch <name>" line per candidate, and
exits without touching any ref.

The @{push}-vs-@{upstream} and unmerged filtering still applies,
so the dry-run output is exactly the set that the live run would
delete.

--dry-run is only meaningful in combination with --prune-merged
and is rejected otherwise.

Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-branch.adoc
builtin/branch.c
t/t3200-branch.sh