Skip to content

git cheat sheet

Jean Cavallo edited this page Jan 16, 2018 · 2 revisions

Git cheat sheet

This page contains the git command that you will have to use for the training module.

View modified files

git status

View current diff

git diff

Checkout a branch

git checkout <branch_name>

Diff against another branch

git diff <target_branch>

Reset changes for one file

git reset --hard <file_name>

Clean all changes (including new files!)

git reset --hard HEAD && git clean -d -f

Mark files for future add (enables diffing a newly created file)

git add --intent-to-add modules/*