Last active
August 8, 2022 14:42
-
-
Save jsonberry/426766b9cf732e9aad98af3eab3de90c to your computer and use it in GitHub Desktop.
Revisions
-
jsonberry revised this gist
Nov 14, 2017 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,10 +7,9 @@ git remote prune origin // List all local branches that were merged into master, explicitly exclude master from that list git branch --merged master | grep -v 'master' /* Delete local branches Each command does not delete master */ // Delete all local branches that were merged into master -
jsonberry revised this gist
Oct 31, 2017 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,16 +8,16 @@ git remote prune origin git branch --merged master | grep -v 'master' /** * Delete local branches * Each command does not delete master * */ // Delete all local branches that were merged into master git branch --merged master | grep -v 'master' | xargs git branch -d // Safe deletion of all local branches (branches not merged into master will not get purged) git branch | grep -v 'master' | xargs git branch -d // Force delete of all local branches git branch | grep -v 'master' | xargs git branch -D -
jsonberry revised this gist
Oct 31, 2017 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,10 +7,11 @@ git remote prune origin // List all local branches that were merged into master, explicitly exclude master from that list git branch --merged master | grep -v 'master' /** * Purge local branches * Each command does not purge master * */ // Purge all local branches that were merged into master git branch --merged master | grep -v 'master' | xargs git branch -d -
jsonberry revised this gist
Jan 31, 2017 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,10 +8,8 @@ git remote prune origin git branch --merged master | grep -v 'master' /* * Purge local branches * Each command does not purge master */ // Purge all local branches that were merged into master -
jsonberry revised this gist
Jan 31, 2017 . 1 changed file with 13 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,18 @@ git remote prune origin // List all local branches that were merged into master, explicitly exclude master from that list git branch --merged master | grep -v 'master' /* * * Purge local branches * Each command does not purge master * */ // Purge all local branches that were merged into master git branch --merged master | grep -v 'master' | xargs git branch -d // Safe purge of all local branches (branches not merged into master will not get purged) git branch | grep -v 'master' | xargs git branch -d // Force purge of all local branches git branch | grep -v 'master' | xargs git branch -D -
jsonberry created this gist
Jan 26, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ // List all remotely tracked branches that do not exist in the remote repo git remote prune origin --dry-run // Prune all remotely tracked branches that do not exist in the remote repo git remote prune origin // List all local branches that were merged into master, explicitly exclude master from that list git branch --merged master | grep -v 'master' // Remove all local branches that were merged into master, do not include master git branch --merged master | grep -v 'master' | xargs git branch -d // Remove all local branches _not_ merged into master, do not include master git branch | grep -v 'master' | xargs git branch -d