GIT command table

Basic Git command blocks

Basic Change Commands Result
git status Lists all new or modified files to be committed
git add [file] Snapshots the file in preperation for versioning
git diff Shows file differences not yet staged
git diff --staged Shows file differences between staging and the last file version
git reset [file] Unstages the file, but preserve its contents
git reset [commit] Undoes all commits after [commit], preserving changes locally only
git reset --hard [commit] Discards ALL history and changes back to specified commit
git commit -m "message" Records file snapshots permamently in history
git push [alias] [branch] Uploads all local branch commits to git
git pull Downloads bookmark history and incorperates changes
git merge [bookmark]/[branch] Combines bookmark into local branch
git show [commit] Displays metadata and contents changes for [commit]


Refactoring Commands Results
git rm [file] Deletes the file from the working directory and stages the deletion
git rm --cached [file] Removes the file from version control only, keeps local file
git mv [original] [new] Renames [original] to [new] and prepares it for commit

Posted on 18th Jun 2018