Skip to content

Instantly share code, notes, and snippets.

@possibilities
Last active December 11, 2015 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save possibilities/4665774 to your computer and use it in GitHub Desktop.
Save possibilities/4665774 to your computer and use it in GitHub Desktop.

Git For People Who Want To Git

Terms

Working tree All uncommited changes

Staging area Uncommited changes you've told git you want to include in a commit

Branches

Creating branches

git checkout BRANCHNAME

Creating a branch and checking it out

git checkout -b BRANCHNAME

Reviewing changes

All changes in your working tree

git diff

All staged changes

git diff --cached

Getting ready to commit (aka Staging changes)

Stage everything in working tree

git add .

Stage all changes in one file

git add path/to/file.txt

Stage all changes in multiple files

git add path/to/file.txt path/to/another.txt

Interactively stage changes piece by piece

git add -p

Committing

Commit everything that you've staged

git commit -m "A meaningful message about what you're commiting"

Stage everything in your working tree and commit it

git commit -am "A meaningful message about what you're commiting"

Pushing your changes to github

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