Skip to content

Instantly share code, notes, and snippets.

@danielshir
Created November 1, 2015 13:21
Show Gist options
  • Save danielshir/06f19845fdf894a804a0 to your computer and use it in GitHub Desktop.
Save danielshir/06f19845fdf894a804a0 to your computer and use it in GitHub Desktop.
Useful bash and shell commands
# Useful command to delete remote branches that are merged to currently checked out HEAD
git branch -a --merged | grep BAK | grep -v <CURRENT_BRANCH_NAMEHERE> | sed 's/[ ]*remotes\/origin\///' | xargs -I name git push origin :name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment