Skip to content

Instantly share code, notes, and snippets.

@robmint
Last active June 1, 2016 21:44
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 robmint/f4c7578950797f13dfa42c5c4318ff96 to your computer and use it in GitHub Desktop.
Save robmint/f4c7578950797f13dfa42c5c4318ff96 to your computer and use it in GitHub Desktop.
Git cheatsheet

Show branches still to be merged to master

git fetch
git branch --no-merged master

Create new branch and switch to it

git checkout -b my-new-branch

Show files changes from a stash

git stash show -p stash@{0}

Reset latest local commit

git reset HEAD~1

Reset all local commits back to a public branch

git reset --hard origin/master

or

git reset --hard origin/production

Create a new tag

git tag 'v1.2.2'
git push origin 'v1.2.2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment