Skip to content

Instantly share code, notes, and snippets.

@aaronmoodie
Last active August 29, 2015 13:55
Show Gist options
  • Save aaronmoodie/8712842 to your computer and use it in GitHub Desktop.
Save aaronmoodie/8712842 to your computer and use it in GitHub Desktop.
My Collection of git commands
$ git log #show commit history
$ git revert <hash> # reverts changes in that commit
$ git show <hash> | gist -t diff # create diff of commit and pipe to gist
$ git diff —staged # show diff of added (staged files)
$ git rebase -i # interactive rebase
$ git rebase —abort # undo a rebase
$ git cherrypick <hash> # moves a commit from one branch to another
$ git push origin <branch> # push review/branch to github
$ git commit —amend # add changes to the last commit
$ git stash show <stash name> # view changes in stash
$ git stash clear # remove all stashes
$ git stash drop <stash name> # removes this stash
$ git reset --soft 'HEAD^' # unstage last commit
$ git diff --cached # show diff when files have been staged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment