git 命令行

1.配置                  :git config --global <配置名称> <配置的值> 。              ex:1.git config --global user.name "lwx"      2.git config -- global user.email "lwx_19920909@sina.cn"

2.克隆项目            :git clone网址                     ex:git clone  https://github.com/chef-cookbooks/php.git

3.初始化               :git init

4.添加到本地仓库    :git add

<1>所有文件         :git add .

<2>单个文件   :git add <文件名>                   ex: git add a.php

<3>多个文件   :git add <文件名> <文件名>              ex: git add c.php d.php  

5.添加到本地代码库:git commit -a -m"注释"

6.查找代码不同      : working tree: 文件修改后变化    index file:(缓存区) 文件add 后发生变化    commit:(本地代码库)文件commit 后变化

(working tree 和index file区别):  git diff

(index file 和 commit区别):     git diff --cached

(working tree 和 commit区别):  git diff HEAD

 

posted on 2017-02-06 18:12  diko  阅读(62)  评论(0)    收藏  举报