wiki:GitCheatSheet

Version 5 (modified by Jiri Svoboda, 6 years ago) ( diff )

Printing staged and unstaged changes

Git Cheat Sheet

Print default push/pull location

git remote -v

Add modified files to staging area

git add -u

Unstage a staged file

git reset HEAD <file>

Revert file changes

git checkout -- <file>

Ammend the last commit

git commit --ammend

Remove the last commit (keep changes in working copy)

git reset HEAD~ 

Print older revision of a file

git show REVISION:path/to/file

Priting only unstaged changes

git diff

Priting only staged changes

git diff --cached

Priting both staged and unstaged changes

git diff HEAD
Note: See TracWiki for help on using the wiki.