Show Menu
Cheatography

Git cheatsheet

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
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Git Cheat Sheet