Skip to content

Instantly share code, notes, and snippets.

@weeksdev
Last active December 19, 2018 15:41
Show Gist options
  • Save weeksdev/aa8885860dc4b0656b19390a0754c09b to your computer and use it in GitHub Desktop.
Save weeksdev/aa8885860dc4b0656b19390a0754c09b to your computer and use it in GitHub Desktop.
Git Commands Cheatsheet

Basic Commands

Add all files for staging:

git add -A

Commit all changes that are staged:

git commit -m "some message"

Push those changes to the remote repo:

git push origin master

Pull changes in from the remote:

git pull origin master

Stash your changes for latter pop:

git stash

Pop the changes:

git stash pop

Advanced Commands

Remove all local commits but don't change any files:

git reset HEAD^

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