简体   繁体   English

如何将“tig show commit-1 commit-2 patch”的输出写入文件?

[英]How to write in file the output from "tig show commit-1 commit-2 patch"?

I'd like to write into a file the output from tig show commit-97b061ff commit-59466662 patch我想将tig show commit-97b061ff commit-59466662 patch的输出写入文件

I tried tig show commit-97b061ff commit-59466662 patch >file.txt , but the file was empty.我试过tig show commit-97b061ff commit-59466662 patch >file.txt ,但文件是空的。 I expected that it would contain the patch actual.我预计它会包含实际的补丁。

How can I solve it?我该如何解决?

If I'd want to save a patch I'd just do如果我想保存补丁,我会这样做

git show $commit > file.diff

You can save the current view in tig with :save-view file.txt but it's for testing purposes - it adds a lot of additional internal information to diff lines, so if you were to use it you'd have to strip those off.您可以使用:save-view file.txt将当前视图保存在 tig 中,但它是用于测试目的 - 它向差异行添加了许多额外的内部信息,因此如果您要使用它,您必须将它们去掉。

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

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