Git Cheat Sheet

design for digital media environments
git

Github

$ git config- –global user.name “[name]” – sets the name

Repositories:

$ git init [project name] – new local repository

$ git clone – downloads project

Changes:

$ git status – lists modifies files to be committed

$ git diff – shows file differences

$ git add [file] – snapshots file for versioning

$ git reset [file] – unstages file

$ git commit -m “[message]” – records file snapshot

Review:

$ git log – lists version history

$ git show [commit] – outputs content changes of that commit

Redo:

$ git reset [commit] – undoes all commits after [commit]

$ git reset –hard [commit] – discards all history, changes back to the commit

Synchronise:

$ git fetch [bookmark] – downloads all history

$ git merge[bookmark]/[branch] – combines bookmarks branch to local branch

$ git push [alias] [branch] – uploads all commits to git hub

$ git pull – downloads bookmark history and incorporates changes

gittest

Changes made using terminal

Advertisements