Skip to content

Instantly share code, notes, and snippets.

@novinfard
Last active March 26, 2020 15:23
Show Gist options
  • Save novinfard/6e14942548754610ac90e95d5ac454f7 to your computer and use it in GitHub Desktop.
Save novinfard/6e14942548754610ac90e95d5ac454f7 to your computer and use it in GitHub Desktop.
[Remove branches which are not available in remote anymore in Git] #git #shell
git branch -v|grep \\[gone\\]|awk '{print $1}'|xargs -I{} git branch -D {}
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment