git init projectgit config --global user.name "Tim Berglund"git config --global user.email "[email protected]"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- Log live command: https://gist.github.com/3714970
- 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 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>- Resolving a conflicted pull request
git ls-remote origingit fetch /refs/pull/18/headgit merge FETCH_HEAD
- Rebasing
git rebase <feature>git rebase -i HEAD~5
- Undo
git refloggit reset --hard HEAD@{1}
Created
October 15, 2012 15:59
-
-
Save tlberglund/3893268 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