2012-08-23
Git指令只要久沒打就忘光光,只好乖乖的memo一下...囧rz
git help [cmd]
git config --global -l
git config --global user.name "my_name"
git config --global user.email "my_name@email.com"
git init .
git init --bare
git status
git add .
git commit -a -m "commit message"
git diff
git diff [file_name]
git show
git show HEAD^
git show [file_name]
git log
git log [file_name]
git log --graph --decorate --all
git checkout [file_name]
git reset --hard
git reset --hard HEAD^
git branch -a
git branch [branch_name]
git checkout [branch_name]
git branch -d [branch_name]
git tag
git tag [tag_name]
git tag -d [tag_name]
git checkout master
git merge branch1
git checkout branch1
git rebase master
git remote -v
git remote add origin https://github.com/cloudtu/git-demo.git
git remote rm origin
git push --all origin
git push --tags origin
git pull origin
git push origin master
git pull origin master
git reset --hard HEAD^
git clone https://github.com/cloudtu/git-demo.git git-demo
git checkout origin/branch1 -b branch1