简体   繁体   English

在提交中添加新添加的文件时使用TortoiseGit diff命令时出错

[英]Error when using TortoiseGit diff command with new added file in commit

I try to make my custom program working with git. 我尝试使我的自定义程序与git一起使用。 Some task like compare difference between two files I just create new process and run TortoiseGit Commands like this 一些任务,例如比较两个文件之间的差异,我只是创建新进程并像这样运行TortoiseGit命令

/command:diff /startrev:20404fc1039ce9ee73f0d16213319afe480b0a05 /endrev:294e111888ed87a8c93a898f6e6f061b15250e0d /path:D:/Project/ReportingTool/Src/Reports.Types/Report.cs

On modified committed file , I got the same result as TortoiseGit UI. 在修改的提交文件上 ,我得到的结果与TortoiseGit UI相同。 picture here 图片在这里

the problem is, on new added committed file there are no file in previous revision to checkout to compare. 问题是,在新添加的提交文件中,先前版本中没有要进行比较的文件。 an error says 错误说

failed to checkout file "files/powershell/App_BuildAndDeploy.ps1" of 
revision 62f7869c1780e6501ec1c4dc0387f03efbde10da to 
"C:\Users\ME\AppData\Local\Temp\TortoiseGit\AppAAD3.tmp\App_BuildAndDeploy-
62f7869-left.ps1" libgit2 returned:the path 'App_BuildAndDeploy.ps1' does 
not exist in the given tree

How to get a result like TortoiseGit like this picture, desired result . 这张图如何得到像TortoiseGit的结果, 理想的结果

i know i can just create new empty file somewhere and use it to compare but i am not sure that is the best/correct way to do it 我知道我可以在某个地方创建一个新的空文件并使用它进行比较,但是我不确定这是最好/正确的方法

This was an issue in older versions of TortoiseGit and is fixed in TortoiseGit 2.5.0. 这是旧版TortoiseGit中的一个问题, 在TortoiseGit 2.5.0中修复

Please note: That /startrev: and /endrev: parameters were mixed up in older versions, you might need to ajust these values. 请注意: /startrev:/endrev:参数在旧版本中混合使用,您可能需要调整这些值。

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

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