[英]How do I view previous diff commits using Git?
How do I view previous diff commits using Git? 如何使用Git查看以前的diff提交?
I have a file that I've made several commits on, but I want to view previous versions of the file AND its diff's at different stages. 我有一个文件,我已经提交了几个提交,但我想查看文件的先前版本及其不同阶段的差异。 Seeing where I made mistakes and how I fixed them is really helping my code. 看到我犯错误的地方以及我如何解决这些错误确实有助于我的代码。 By the way, I'm using Tower as a GUI on top of Git. 顺便说一下,我在Git上使用Tower作为GUI。
git log --full-diff -p your_file_path
Check out: 查看:
http://git-scm.com/docs/git-log http://git-scm.com/docs/git-log
You need git log
. 你需要git log
。 If you were interested in file SOMEFILE
use 如果您对文件SOMEFILE
感兴趣, SOMEFILE
使用
$ git log -p SOMEFILE
The -p
option displays the patch which is probably the diff you are looking for. -p
选项显示可能正在寻找的差异的补丁。
如果您不想指定特定文件,并且看到所有文件的差异已更改,请使用
$ git log -p
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.