Skip to content

Instantly share code, notes, and snippets.

@kutyel
Created February 21, 2018 14:28
Show Gist options
  • Save kutyel/9b51c4350f07cc85f71e0e73e2788b1a to your computer and use it in GitHub Desktop.
Save kutyel/9b51c4350f07cc85f71e0e73e2788b1a to your computer and use it in GitHub Desktop.
Fish function that removes all the local git branches that have already been merged
function clear_local_branches --description 'Removes all the local branches that have already been merged'
command git fetch -p; and git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment