Update The tool git-delete-merged-branches did not work great for me. I recommend git-town prune-branches
now.
The tool git-town offers prune-branches:
git-town prune branches
It then asks for the main development branch. You need to select your main
or master
branch:
Git Town needs to be configured
? Please specify the main development branch: main
Afterwards, it asks for "perennial" branches, which are branches besides the main branch, should be kept. Examples are branches for next versions etc.
? Please specify perennial branches:
Then, it goes forward with deletion:
[main] git fetch --prune --tags
From github.com:JabRef/jabref
[main] git branch -d remove-sav-file
Deleted branch remove-sav-file (was 33c1a869e1).
[main] git branch -d remove-bibtexml
Deleted branch remove-bibtexml (was d21c11337a).
Alternatives
git-delete-merged-branches
The tool git-delete-merged-branches allows for a convenient deletion of branches. I especially like the interactive mode.
Installation (requires python3
):
pip install git-delete-merged-branches
Then execute
git-delete-merged-branches --effort=3 --branch main
--effort=3
is important to enable deletion of squashed branches.
--branch main
is required (as otherwise master
is used)
Other alternatives
- @teppeis/git-delete-squashed: With node.js installed execute
npx @teppeis/git-delete-squashed
. Supports main
branch.
- git-delete-squashed: Not maintained: Misses functionality for
main
branch.. @teppeis/git-delete-squashed is based on this.