Skip to content

Instantly share code, notes, and snippets.

@milkman4
Created October 31, 2016 15:28
Show Gist options
  • Save milkman4/640a9187dac3d599eec504afc275e41c to your computer and use it in GitHub Desktop.
Save milkman4/640a9187dac3d599eec504afc275e41c to your computer and use it in GitHub Desktop.
Git command list

git stash : 'stashes' away the work youve done since the latest commit -"HEAD"

git stash -apply : takes the latest stash from the stash list and applies it to the local working tree state, this does NOT remove the stash from the stash list, like pop

git shortlog : similar to git log, but will create a less verbose summary of the commit history - does not show actual commit IDs, only commit messages!

git commit --amend : Replace the tip of the current branch by creating a new commit - message from the last commit is used as the starting point

git reset -- hard: resets the current branch to a earlier commit - AND discards any changes that are staged for commit

git reset --soft: resets current branch to an earlier commit but does not disard changes staged for commit

git reset --hard HEAD~2: resets current branch to earlier 2 commits from head ~[number] indicates how many commits to revert (?)

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