Last active
October 20, 2025 05:34
-
-
Save nicholashoule/ff5a00c8f02ea57f0b26889f022620f4 to your computer and use it in GitHub Desktop.
Revisions
-
nicholashoule revised this gist
Oct 20, 2025 . 1 changed file with 15 additions and 1 deletion.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 @@ -1,3 +1,17 @@ # Git ### macOS ```Zsh brew install git ``` ### Windows ```Powershell winget install --id Git.Git -e --source winget ``` ## Git prune and delete merged local branches ###### Prune @@ -10,7 +24,7 @@ git remote prune origin --dry-run git remote prune origin ``` ###### Delete (Bash, Zsh) ``` git branch --merged | grep -v \* -
nicholashoule revised this gist
Jan 10, 2020 . 1 changed file with 1 addition and 1 deletion.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 @@ -1,6 +1,6 @@ ## Git prune and delete merged local branches ###### Prune ``` git remote prune origin --dry-run -
nicholashoule revised this gist
Jan 10, 2020 . 1 changed file with 12 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 @@ -2,7 +2,6 @@ ##### Prune ``` git remote prune origin --dry-run ``` @@ -11,12 +10,22 @@ git remote prune origin --dry-run git remote prune origin ``` ###### Delete (Bash) ``` git branch --merged | grep -v \* ``` ``` git branch --merged | grep -v \* | xargs git branch -D ``` ###### Delete (Powershell) ``` git branch --merged | Select-String -Pattern '\*' -notMatch ``` ``` git branch --merged | Select-String -Pattern '\*' -notMatch | % { $_.split()[0] } | % { git branch -D $_ } ``` -
nicholashoule revised this gist
Jun 6, 2019 . 1 changed file with 1 addition and 1 deletion.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 @@ -1,4 +1,4 @@ ## Git prune and delete merged local branches ##### Prune -
nicholashoule renamed this gist
Jun 6, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
nicholashoule renamed this gist
Jun 6, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
nicholashoule renamed this gist
Jun 6, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
nicholashoule revised this gist
Jun 6, 2019 . 1 changed file with 1 addition and 1 deletion.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 @@ -1,4 +1,4 @@ # Git prune and delete merged local branches ##### Prune -
nicholashoule revised this gist
Jun 6, 2019 . No changes.There are no files selected for viewing
-
nicholashoule revised this gist
Jun 6, 2019 . 1 changed file with 1 addition and 1 deletion.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 @@ -1,4 +1,4 @@ # Git prune and delete local branches ##### Prune -
nicholashoule revised this gist
Jun 6, 2019 . 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 @@ -4,7 +4,6 @@ ``` git remote prune origin --dry-run ``` @@ -15,7 +14,6 @@ git remote prune origin ##### Delete ``` git branch --merged | grep -v \* ``` -
nicholashoule revised this gist
Jun 6, 2019 . 1 changed file with 7 additions and 0 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 @@ -2,13 +2,20 @@ ##### Prune ``` # Test git remote prune origin --dry-run ``` ``` git remote prune origin ``` ##### Delete ``` # Test git branch --merged | grep -v \* ``` -
nicholashoule revised this gist
Jun 6, 2019 . No changes.There are no files selected for viewing
-
nicholashoule renamed this gist
Jun 6, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
nicholashoule revised this gist
Jun 6, 2019 . No changes.There are no files selected for viewing
-
nicholashoule created this gist
Jun 6, 2019 .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,17 @@ # Git Prune and Delete local branches ##### Prune ``` git remote prune origin --dry-run ``` ##### Delete ``` git branch --merged | grep -v \* ``` ``` git branch --merged | grep -v \* | xargs git branch -D ```