版本控制器 git 使用简介

来源:互联网 发布:mysql delete语句用法 编辑:程序博客网 时间:2024/05/16 19:30

最近时不时的就会用到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 updategit checkout mastergit pull origin master

修改代码,提交review

git commit -agit review

原创粉丝点击