码迷,mamicode.com
首页 > 其他好文 > 详细

Git 笔记 - git diff and git commit

时间:2015-05-24 18:49:49      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

To see what you’ve changed but not yet staged, type git diff with no other arguments

 

That command compares what is in your working directory with what is in your staging area. The result tells you the changes you’ve made that you haven’t yet staged.

If you want to see what you’ve staged that will go into your next commit, you can use git diff --staged. This command compares your staged changes to your last commit:

 

It’s important to note that git diff by itself doesn’t show all changes made since your last commit – only changes that are still unstaged. This can be confusing, because if you’ve staged all of your changes, git diff will give you no output.

For another example, if you stage the CONTRIBUTING.md file and then edit it, you can usegit diff to see the changes in the file that are staged and the changes that are unstaged. If our environment looks like this:

 

 

git commi -v 

git commit 

git commit -m

Git 笔记 - git diff and git commit

标签:

原文地址:http://www.cnblogs.com/derek-hu/p/4526201.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!