git status 是实现实时观察 工作区间的情况,结合 git diff 实现实时观察,工作区间的情况;
这是我的流程:
dzfdeiMac:xiaohongqi xuyaowen$ git diff #检查工作树与索引区的差别
dzfdeiMac:xiaohongqi xuyaowen$ git diff --cached #检查索引区与 代码仓库之间的区别
dzfdeiMac:xiaohongqi xuyaowen$ cat README.md #检查 文档没修改之前的内容
# xiaohongqi
这是xiaohongqi的测试
你想知道我是用它来干嘛的吗?其实我就是用它来进行自己的项目的管理的
这是用来验证pull 的语句
这是用来验证pull 的语句2
这是用来验证pull 的语句3
这是用来验证pull 的语句4
这是用来验证pull 的语句5
这是用来验证pill 的语句6
这是本地对其的第二次的修改
这是本地对其的第三次的修改
这是第一个分支的测试
这是用来测试git status 而 添加进的语句的情况
dzfdeiMac:xiaohongqi xuyaowen$
dzfdeiMac:xiaohongqi xuyaowen$ nano README.md #修改了文档,添加了一句话
dzfdeiMac:xiaohongqi xuyaowen$ git status #使用git status 显示状态
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
dzfdeiMac:xiaohongqi xuyaowen$ git add . #添加工作树中修改的内容到索引区
dzfdeiMac:xiaohongqi xuyaowen$ git status #显示状态
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: README.md
dzfdeiMac:xiaohongqi xuyaowen$ git commit -m "这是一次提交" #添加索引区的修改到代码仓库之中区
[master e0019a6] 这是一次提交
1 file changed, 1 insertion(+)
dzfdeiMac:xiaohongqi xuyaowen$ git status #查看状态
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
dzfdeiMac:xiaohongqi xuyaowen$ git log #显示更新日志,有相关的内容
commit e0019a671c437d95f17f024eddc5ac23291fe30c
Author: xiaohongqi <651134397@qq.com>
Date: Sun May 3 10:46:43 2015 +0800
这是一次提交
:经过测试你会发现,git status 不但告诉你当前的状态,还提醒你下一步应该干什么;是不是很方便;
进一步了解请阅读我的其他的博文,这样你会对git 的版本控制有根详细的了解;
我个人建议,应看一看 vim 的使用的方法,注意体改自身的的能力,注意能力;
详细的情况请关注我的博客 : 小红旗 http://blog.youkuaiyun.com/happylaoxu 点我快速访问 http://blog.youkuaiyun.com/happylaoxu
我的博文中还有其他的必备的命令的讲解,希望大家,能对git 有更好的认识!