[git] Replace git fetch "gone" tag on merged or removed branches with new git branch --delete-merged flag #231

Open
opened 2026-09-22 11:01:32 +02:00 by vlw · 0 comments
Owner

git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D

If this article is to be believed, git will introduce in version 2.56 a new --delete-merged flag to the git branch command. This would possibly remove the need for this line which uses the "gone" tag on a remote branch that has been removed from the upstream; but still present locally.

https://git.vlw.se/vlw/dotfiles/src/commit/589c6c6c59f09bebf24ab448528426949fa53642/.bash_aliases#L458 If [this article](https://lwn.net/SubscriberLink/1094575/2385e98583715c2b/) is to be believed, git will introduce in version 2.56 a new `--delete-merged` flag to the `git branch` command. This would possibly remove the need for this line which uses the "gone" tag on a remote branch that has been removed from the upstream; but still present locally.
vlw changed title from Replace git fetch "gone" tag on merged or removed branches with new git branch --delete-merged flag to [git] Replace git fetch "gone" tag on merged or removed branches with new git branch --delete-merged flag 2026-09-22 11:01:57 +02:00
Sign in to join this conversation.
No labels
bug
feature
refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
vlw/dotfiles#231
No description provided.