git init projectgit config --global user.name "Tim Berglund"git config --global user.email "tlberglund@github.com"git statusgit add <file>- Diff
git diffgit diff --stagedgit diff --color-wordsgit diff --word-diffgit diff -w
- Logging
git loggit log --statgit log --patchgit log --pretty=rawgit log --pretty=oneline --abbrev-commit --graph
- Aliases
git config --global alias.lol "log --pretty=oneline --abbrev-commit --graph"git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset' --abbrev-commitgit config --global alias.lgl "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C green(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all"
- Deleting
git rm <file>git add -u .
- Moving
git mv <file> <newfile>git add -A .
- Collaborating
git remote add origin <repo url>git push -u origin mastergit config --global branch.autosetuprebase alwaysgit config branch.master.rebase true
- Branching
git branch <branchname>git checkout <branchname>git checkout -b <branchname>
- Merging
git merge <featurebranch>
- Rebasing
- Undo
git refloggit reset --hard HEAD@{1}
-
-
Save practicalli-johnny/3893305 to your computer and use it in GitHub Desktop.
JAX London Git Workshop Notes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment