Skip to content

Instantly share code, notes, and snippets.

@arjanfrans
Last active May 7, 2019 07:32
Show Gist options
  • Save arjanfrans/8f52911a9016ef4cd31e8d416b08d978 to your computer and use it in GitHub Desktop.
Save arjanfrans/8f52911a9016ef4cd31e8d416b08d978 to your computer and use it in GitHub Desktop.
Cleanup local git branches

Cleanup local git branches that are not on the remote.

git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment