最近时不时的就会用到git 工具,但是用的又不频繁,导致每次使用的时候都得重新查阅,很不方便。
这里大概记录一下git的使用方法,便于自己以后查看。
git环境的设置:
$ git config --global user.name "Your Name Comes Here"
$ git config --global user.email you@yourdomain.example.com
(1)项目仓库的建立
git init
该命令在目标目录下建立一个.git目录
(2)添加文件
git add
(3)版本提交
git commit
或者 git commit -m
(4)查看历史
git log
git log --stat --summary
openstack项目中:
提交修订之前,首先确保你拥有最新的代码:
git remote update git checkout master git pull origin master
修改代码,提交review
git commit -a git review