Skip to content

Instantly share code, notes, and snippets.

@ramezanpour
Forked from hoseinit/Git clean deleted Branches
Last active February 12, 2018 08:32
Show Gist options
  • Save ramezanpour/1b6ad89031a2e2dff15a08ec1324dcc3 to your computer and use it in GitHub Desktop.
Save ramezanpour/1b6ad89031a2e2dff15a08ec1324dcc3 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