Search code examples
command-linetig

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

I tried tig show commit-97b061ff commit-59466662 patch >file.txt, but the file was empty. I expected that it would contain the patch actual.

How can I solve it?


Solution

  • 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.