Skip to content

Instantly share code, notes, and snippets.

@sayatul
Last active September 17, 2018 17:29
Show Gist options
  • Save sayatul/73b67207606b504cbad6cd59153e097e to your computer and use it in GitHub Desktop.
Save sayatul/73b67207606b504cbad6cd59153e097e to your computer and use it in GitHub Desktop.
[Useful Git Commands] git
  • To delete all local branches that are already merged into the currently checked out branch: git branch -r --merged | egrep -v "(^\*|master|develop)" | sed 's/origin\///' | xargs -n 1 git push --delete origin

git branch --merged | egrep -v "(^\*|master|develop|dev)" | xargs git branch -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment