Created
June 8, 2020 21:08
-
-
Save johnallers/3349b00d29cb75fb5d50c2f9f77e35db to your computer and use it in GitHub Desktop.
PowerShell functions for finding and removing local branches that have been merged
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
function Find-GitLocalMerged { | |
Write-Host "git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'}}" | |
& git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | |
} | |
function Clean-GitLocalMerged { | |
Write-Host "git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_}" | |
& git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment