Skip to content

Andrei-Vasil/prune-git-branches

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prune-git-branches

This script will prune the local branches that you no longer want. You have 2 options when deleting: --remote or --pattern

Remote

This option will delete all your local branches that are no longer tracked on remote.
Run with -f flag to also remove unmerged branches.

Pattern

This option removes all branches except for the specified parameter branch names. If no branches are specified, the script defaults to removing all non-primary branches using main, master, dev and develop as parameters.

Usage

# note: you are free to alias main.sh however you wish
alias prune-git-branches='/path/to/this/repo/main.sh'
prune-git-branches --remote [-f]
prune-git-branches --pattern [branch1 branch2 branch3 ...]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages