Git Experience and Note

Git and Github are the best version control solution.

Prepare


cd ~/.ssh
ssh-keygen -t rsa -C "xiaofeng.qu.hk@ieee.org"
vi id_rsa.pub
# copy all and paste to the github
ssh git@github.com # testing

Git

Init

Init with code


git init
git remote add ...

Init by clone the repo


git clone ...

Daily push


git pull
git status
git diff
git add .
git add --all
git commit -asm "comment"
git push

Branching


git branch -b newbranch
git add new.txt
git commit -asm "comment"
git checkout master
git merge newbranch

Submodule


git submodule add git://github.com/quxiaofeng/mycv.git _cv
git add .
git commit -asm "added a submodule"
git push

Online Git Branching Tutorial




An example image of the git tutorial