版本回退

# 本地回退
# git reset --hard <commit_id>
git reset --hard HEAD^
# 强制回退远程仓库代码
git push -f

版本合并

# 将 dev 的版本合并到 master
git checkout master
git merge dev # 这个命令把分支dev("branchname")合并到了当前分支里面

拉取版本

# 默认使用 ssd协议
git clone git@mydomain.com:zaza/test.git

# 指定 ssh 协议、端口
git clone ssh://git@mydomain.com:[port]/test

# http协议
git clone http://www.kernel.org/pub/scm/git/test.git

tab补全

cp /usr/share/doc/git-1.7.1/contrib/completion/git-completion.bash /etc/bash_completion.d/
echo 'source /etc/bash_completion.d/git-completion.bash' >> ~/.bashrc

# 生效
source /etc/bash_completion.d/git-completion.bash