Last active
April 25, 2019 14:55
-
-
Save kellyfj/702db34caa807a509c79 to your computer and use it in GitHub Desktop.
To find and clean-up old Git remote branches that have been merged to master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#List all remote branches merged to master | |
git branch -r --merged | |
#For all old branches log last commit e.g. | |
git log --decorate -1 origin/Gauss | |
#To delete the branches you want | |
git push origin --delete Gauss | |
#For everyone to run locally to remove the remove references | |
git remote prune origin | |
#To show the # of branches remaining | |
git branch -r | wc -l | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment