Skip to content

Instantly share code, notes, and snippets.

@neverendingqs
Created September 7, 2015 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neverendingqs/cec188d23afe9621fa01 to your computer and use it in GitHub Desktop.
Save neverendingqs/cec188d23afe9621fa01 to your computer and use it in GitHub Desktop.
Delete all local branches that has been merged on remote.
# Can also add to PowerShell profile
function Git-RemovedMergedBranches {
git branch --merged |
? { $_ -NotMatch "^\*" } |
? { $_ -NotMatch "master" } |
% { $_.Trim() } |
% { git branch -d $_ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment