简体   繁体   English

带有重命名的Git文件diff / history

[英]Git file diff/history with renames

I need to do a git diff between the the file at the current HEAD and a past date. 我需要在当前HEAD的文件和过去的日期之间做一个git diff。 However here's the kicker: the file extension has been RENAMED which poses a problem for most GUI tools. 但是,这里有一个关键点:文件扩展名已被重命名,这对大多数GUI工具来说都是一个问题。 ie, XCode has this feature but it breaks because of the renamed file despite git being (I think) capable of doing this. 即,XCode具有此功能,但是尽管git可以做到这一点,但由于重命名的文件而使它损坏。

Does anyone know how to manually perform this diff? 有人知道如何手动执行此差异吗?

thanks 谢谢

For any single file, you can just use revision:path syntax on both files. 对于任何单个文件,您都可以在两个文件上都使用revision:path语法。 For example, you can do the following. 例如,您可以执行以下操作。

git diff HEAD:Foo 1af1f21845f:Foo.cc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM