- Some philosophical thoughts
- Configuration
git config --global user.name "Name"
git config --global user.email "[email protected]"
git config --global color.ui auto
- Creating a Repo
git init newproject
- Add files
git add caesar.txt
git commit -m "Message"
- Commit files
git commit -m "Message"
- Look at diffs
git diff
git diff --staged
git diff HEAD
git diff --color-words
git diff --word-diff
- Look at history
git log
git log --stat
git log --patch
git log --pretty=full
git log --pretty=raw
git 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 master
git pull
git pull --rebase
git config --global branch.autosetuprebase always
git 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