Git basics Cheat Sheet

A Programming › Git cheat sheet in English by teererai.marange

Git cheatsheet

7,641 views 2,472 downloads 23 May 2016 History
3.7 avg · 0 ratings

Initial Config

git config --global user.name "­Tee­rer­ai"
git config --global user.email "­tma­r08­0@a­uck­lan­dun­i.a­c.n­z"
git config --global color.ui "­aut­o"
git config --list
git init
Initial Setup of email and user.name for git

Ignoring stuff

Create file .ignore in project folder and add paths to files to ignore.

Checking changes

git status
git status --ignored
git add somefi­le.txt
git commit -m "some messag­e"
git log
git diff
git diff --staged

Remotes

git remote -v
git push origin master
git pull origin master

Exploring History

HEAD~X
X commits from the last one where X is int.
HEAD
Last commit
git diff HEAD~X
diff for head-X
git checkout HEAD~X
restores head-X

Badges

Nice Cheat Sheet Good Cheat Sheet

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.