Skip to content

Instantly share code, notes, and snippets.

@damwhit
Last active March 4, 2016 18:12
Show Gist options
  • Save damwhit/07c1b12fee8940cc5f74 to your computer and use it in GitHub Desktop.
Save damwhit/07c1b12fee8940cc5f74 to your computer and use it in GitHub Desktop.

#Git Commands

##git stash

  • git stash is used to save the state of your working directory as well as your index directory.
  • It also reverts you back to a clean directory at your HEAD commit.

##git stash apply

  • git stash apply allows you to revert to a previous stash by either specicfying ie. git stash apply stash@{2}, which will take you back to the specified stash.
  • Or, simply typing git stash apply will revert to your most recent stash.

##git shortlog

  • ths outputs a summary of the log read from standard input, without reference to the current repository. Lists all commits by all authors in individualized lists

##git commit --amend

  • --amend allows you to combine staged changes with the previous instead of committing it as an entirely new snapshot.

##git reset --hard

  • This resets the index and the working tree. Any changes to tracked files since the last commit are discarded.

##git reset --soft

  • This does not touch the index or working tree but resets the head to the latest commit and leaves all files unstaged.

##for rebasing

  • git config --global core.editor "atom —wait"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment