- Some philosophical thoughts
- Configuration
git config --global user.name "Name"git config --global user.email "email@address.com"git config --global color.ui auto
- Creating a Repo
git init newproject
- Add files
git add caesar.txtgit commit -m "Message"
- Commit files
git commit -m "Message"
- Look at diffs
git diffgit diff --stagedgit diff HEADgit diff --color-wordsgit diff --word-diff
- Look at history
git loggit log --statgit log --patchgit log --pretty=fullgit log --pretty=rawgit log --pretty=raw -1- git config --global alias.lol "log --graph --pretty=oneline --abbrev-commit"
- git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all"
- Deleting files
git rm <filename>git add -u .
- Move files
git mv <oldfile> <newfile>git add -A .
- Branching and merging
git branch <branchname>git checkout <branchname>git merge <branchname>
- Network operations
- Remotes
git remote add origin https:/...
- Fetch/pull/push
git push -u origin mastergit pullgit pull --rebasegit config --global branch.autosetuprebase alwaysgit config branch.<branchname>.rebase true
- Clone
- Remotes
Created
November 6, 2012 15:59
-
-
Save githubteacher/4025654 to your computer and use it in GitHub Desktop.
Øredev Git Workshop
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment