Cheatography
https://cheatography.com
Initial Config
git config --global user.name "Teererai"
|
git config --global user.email "tmar080@aucklanduni.ac.nz"
|
git config --global color.ui "auto"
|
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 somefile.txt
|
git commit -m "some message"
|
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 |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets