Skip to content

Instantly share code, notes, and snippets.

@linkesch
Created February 10, 2018 17:45
Show Gist options
  • Save linkesch/a16c654ec2c46e3a0650ad4b0d9cfe3c to your computer and use it in GitHub Desktop.
Save linkesch/a16c654ec2c46e3a0650ad4b0d9cfe3c to your computer and use it in GitHub Desktop.
Git tip: Have a lot of old branches on your machine? Here's a Bash script that removes local branches that are no longer remote: https://twitter.com/housecor/status/961942463006027776
git fetch -p && for branch in `git branch -vv --no-color | 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