标签:git
cd git_root_dir
git init
git init git_root_dir
~/.gitconfig 或者 git_root_dir/.git/config
git config --global core.editor "vim"
git config --global user.name "Christian Sheng"
git config --global user.email "xxxxx@yeah.net"
git config --global alias.st status
git config --global alias.cm commit
git config --global alias.ck checkout
git config --global alias.br branch
git config --list
git add file_name
git add . #All Files
git commit -m “some commend text”
git branch
git branch branch_name
git checkout branch_name
git checkout -b branch_name # git checkout命令加上-b参数表示创建并切换,等于上面两条
git branch -d branch_name
git branch -D branch_name # 强制删除
git log
git reflog
git log --graph --pretty=oneline --abbrev-commit
git checkout -- file_name
git reset HEAD file_name
git merge branch_name
git reset --hard HEAD^ #回退1个
git reset --hard HEAD^^ #回退2个
git reset --hard HEAD~8 #回退8个
git reset --hard 3628164 #Jump to 3628164
git remote add origin git@github.com:christiansheng/git-school.git
git push -u origin master # for first time
git push origin master # for later push
git fetch
git merge
git pull
git blame filename
git show hashnumber
git clean -df
git clean -f -d -x
git branch -ar | less
git checkout origin/rel-22
git cm -a 用于cherry-pick他人的change时的commit、
git cm --amend ,修改 最近一次commit的注释
git push origin HEAD:refs/for/rel-22 #make a change
标签:git
原文地址:http://blog.csdn.net/christiansheng/article/details/45825463