发布于 2009-11-24 05:39:19
使用git log查看提交历史记录。每个提交都有一个关联的修订版说明符,它是一个散列键(例如14b8d0982044b0c49f7a855e396206ee65c0e787和b410ad4619d296f9d37f0db3d0ff5b9066838b39)。要查看两个不同提交之间的差异,请使用带有两个提交的修订说明符的前几个字符的git diff,如下所示:
# diff between commits 14b8... and b410...
git diff 14b8..b410
# only include diff of specified files
git diff 14b8..b410 path/to/file/a path/to/file/b如果您想全面了解从提交到提交的所有差异,请使用带有修补程序选项的git log或git whatchanged:
# include patch displays in the commit history
git log -p
git whatchanged -p
# only get history of those commits that touch specified paths
git log path/a path/b
git whatchanged path/c path/d发布于 2009-11-24 05:20:15
看起来你想要git diff和/或git log。另请查看gitk
gitk path/to/file
git diff path/to/file
git log path/to/file发布于 2012-08-28 05:30:50
我喜欢使用gitk name_of_file
这将显示在每次提交时对文件所做的更改的列表,而不是显示对所有文件所做的更改。使得追踪发生的事情变得更容易。
https://stackoverflow.com/questions/1786027
复制相似问题