Created
July 22, 2020 08:23
-
-
Save richja/b9c076ee4ed648cd840434084b48bf7e to your computer and use it in GitHub Desktop.
Delete old remote branches on Git
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
//sort remote branches by oldest last commit date | |
git branch -r --sort=committerdate | xargs echo | |
//pick all remote branches and remove origin/ part or use something sed to do it automatically (https://stackoverflow.com/a/40010115) | |
git push origin --delete <remote branches here> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment