Last active
August 29, 2015 13:55
-
-
Save aaronmoodie/8712842 to your computer and use it in GitHub Desktop.
My Collection of git commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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