Skip to content

Instantly share code, notes, and snippets.

@hoseinit
Last active February 12, 2018 08:31
Show Gist options
  • Save hoseinit/01fe3e034d828067a2501edb6fc03cf9 to your computer and use it in GitHub Desktop.
Save hoseinit/01fe3e034d828067a2501edb6fc03cf9 to your computer and use it in GitHub Desktop.
Remove Merged Branches from Local Git
// Gitlab projects
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
//or on Github projects:
git branch --merged | grep -v '*' | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment