nu_scripts/modules/git/git_branch_cleanup.md
Eric Hodel db9606af6c
Improve git branch cleanup script (#685)
This implementation prunes local branches that have been merged and
optionally prunes remote branches that have been merged.

The script may be configured to keep branches through local git
configuration.

The remote name can be autocompleted.
2023-12-10 09:05:57 -06:00

440 B

Git branch cleanup

Remove any local git branches that have been merged and optionally remove any remote branches that have been merged.

Load with:

source modules/git/git_branch_cleanup.nu

To remove merged branches:

git branch-cleanup

To keep merged branches that start with "releases/":

git config --local --add branch-cleanup.keep 'releases/.*'

Keep branch patterns are space-separated