Skip to content

Instantly share code, notes, and snippets.

@rubberduck203
Created January 3, 2020 17:51
Show Gist options
  • Save rubberduck203/8eb0078ec85c0857a2166d429d566073 to your computer and use it in GitHub Desktop.
Save rubberduck203/8eb0078ec85c0857a2166d429d566073 to your computer and use it in GitHub Desktop.
Powershell function for deleting merged git branches
function Delete-MergedBranches() {
Foreach($branch in (git branch --merged master | Select-String ".*master" -NotMatch)) {
git branch -d $branch.ToString().Trim()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment