查看 git 中分阶段更改的差异
可能的重复:
如何显示已上演的更改?< /a>
有没有一种简单的方法来查看我在 git 中待处理的暂存更改的差异?我已经暂存了几个文件,但想在按下按钮之前最后看一下我正在提交的内容。我还有其他几个未暂存的更改,我想在单独的提交中进行,因此取消暂存,执行 git diff,然后分页到我想要的文件并不是一个理想的选择。
示例:
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: foo.java
#
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: bar.java
# modified: baz.java
# modified: qux.java
我真的只是想看看我在 foo.java 中更改了什么,而无需取消暂存。
Possible Duplicate:
How do I show the changes which have been staged?
Is there a simple way to view the diff of only the staged changes I have pending in git? I've staged several files but want to take one last look at what I'm committing before I push the button. I have several other unstaged changes that I want to go in a separate commit, so unstaging, doing git diff
, and then paging through to the file I want isn't all that desirable an option.
Example:
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: foo.java
#
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: bar.java
# modified: baz.java
# modified: qux.java
I really just want to see what I changed in foo.java
without having to unstage.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谷歌搜索一分钟当然找到了答案,回答了我自己的问题:
One more minute of Googling found the answer of course, answering my own question: