how to use git (2)

建仓库添加文件以及commit的过程:

1.进入目标目录

2.git init 初始化仓库

3.git add <filename>  将文件加入staging area

4.git commit 提交commit

   git commit -m "Commit Message" 

之后修改commit过程循环上述过程3、4

 

Git diff:

git diff  比较当前工作目录和staging area

git diff --staged 比较staging area和last commit

 

Git branch

分支用于增加可能不适用的特性、改变语言....等

可用命令:

git branch 查看分支

git branch <branchName> 创建新的分支

git checkout <branchName> 切换到分支

posted on 2016-01-27 20:13  gavinXing  阅读(122)  评论(0)    收藏  举报