Skip to content

Instantly share code, notes, and snippets.

@danishabdullah
Created December 5, 2014 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danishabdullah/e7e50901862c8a4ea90a to your computer and use it in GitHub Desktop.
Save danishabdullah/e7e50901862c8a4ea90a to your computer and use it in GitHub Desktop.
delete unnecessary branches in git
for k in $(git branch | sed /\*/d); do 
  if [ -n "$(git log -1 --since='12 week ago' -s $k)" ]; then
    git branch -D $k
  fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment