《Git版本控制管理》第一部分:常用命令

一.git的一些概念:http://guibin.iteye.com/blog/1014369

二.git中常用命令

git help                 -查看常用命令

git help -a             -查看命令列表

git help [命令]             -查看具体命令

 

1.git init                   -创建一个空的版本库

2.git add ./             -将当前目录下所有文件添加到版本库里

 

3.git status                             -查看已添加到版本库,将要提交的内容

4.git show eca904303e7de147b1cd5136f149542a4b28afa0     -查看提交码对应的详细信息

5.git commit -m “完成了xxx功能”                      -提交新添加的文件

6.git commit index.html                     -提交修改过的文件     

7.git log                             -查看提交

8.git diff eca904303e7de147b1cd5136f149542a4b28afa0 \c3e337f1e64f7b6c9c6758d503f42adca876d654

                                 -查看提交差异。第一个是旧的提交码,第二个是新的提交码

9.git show-branch     --more=10                 -查看最近提交的10条信息

 

 

10.git rm thrid.html                        -删除一个文件 

11.git mv second.html forth.html                -对某个文件重命名

12.git clone public_html my_website              -本地克隆一份新的版本库

posted @ 2015-08-02 17:57  forrHuen  阅读(148)  评论(0编辑  收藏  举报