Skip to content

Instantly share code, notes, and snippets.

@notmarkmiranda
Created April 14, 2016 15:43
Show Gist options
  • Save notmarkmiranda/5e2ce378e5a45bfb2e9f6eeb5d8637ac to your computer and use it in GitHub Desktop.
Save notmarkmiranda/5e2ce378e5a45bfb2e9f6eeb5d8637ac to your computer and use it in GitHub Desktop.

Research what each of these Git commands will do. Create a gist that you can share with your team.

git stash

git stash apply

  • reverts back to where you were before you used 'git stash'

git shortlog

  • returns a condensed version of git log: Author(number of commits) Commit Message
  • does not contain commit hash, merge information for branches, or date/time

git commit --amend

  • allows you to amend commit messages that have not been pushed online

git reset --hard

  • discards changes you've made since your last commit (I think)

git reset --soft

  • moves back to last commit without discarding changes (I think)

git reset --hard HEAD~2

  • moves the head back 2 commits

Find three different ways to display the git log. One example is git log --oneline. git log --graph git log --merges

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