Git
- reference http://www.jianshu.com/p/6d1ce5b65523 and http://learngitbranching.js.org/?demo
- Install http://cmder.net/ (including MsysGit)
- Config
1
2
3
4
5
6
7git config --global user.name "xxx"
git config --global user.email "xxx@yyy"
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.br branch
git config --list //~\.gitconfig
Check in
1 | git init |
Revert
1 | git reflog //review commit id for revert |
Change
1 | git rm xxx |
Branch
1 | git checkout -b xxx // git branch xxx && git checkout xxx |
gitignore when it doesn’t work:
1 | git rm -r --cached . |
Github
Generate SSH key
1 | ssh-keygen -t rsa -C"mail" //id_rsa and id_rsa.pub |
.ssh/config
1 | Host github.com |
Upload
1 | git remote add origin git@github.com:sevenbamboos/test.git |
Merge
1 | git mergetool |