Skip to content

Instantly share code, notes, and snippets.

@psdcoder
Last active February 27, 2019 09:28
Show Gist options
  • Save psdcoder/5346323 to your computer and use it in GitHub Desktop.
Save psdcoder/5346323 to your computer and use it in GitHub Desktop.
GIT Snippets

Local

Sync local branches with remote

git remote prune origin

Remove merged branches

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

Run garbage collector

git gc

Check diff with production remote

git log --left-right --graph --cherry-pick --oneline production/master...master

Remote

Remove remote branch

git push origin :branchName

Delete tag with name: tagName from the remote repository

git push origin :refs/tags/tagName

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