Good day. Please help. How to compare 2 commits of a single file in a visual tool, such as WinMerge?

    1 answer 1

    just compare two versions of the file

    git diff <sha1_1> <sha1_2> -- filename 

    two minuses suggest to the gita that what’s next is the file name, not the parameters. ha1_1 and sha1_2 are the hashes of commits to compare. You can also write the names of branches / tags.

    if you need to open it in a third-party utility, then another difftool command is used. But she needs to specify the "tool".

     git difftool -t winmerge <sha1_1> <sha1_2> -- filename 

    it is quite possible that he will not find it. Then you need to winmerge register in the search path. Or configure gitconfig correctly .

    • Thanks, it turned out. Here is the syntax works (WinMerge registered in .gitconfig): git difftool 5fc639348d71eb374d97be157fa44cb6b736b586 c332 baa4b5e0d1824f2cbfbb09934ecc92c2f369 - " imya_fayla_kirillitsa.txt" - Nikolai