Is there a way to configure git to use a different difftool based on the file extension?

487 Views Asked by At

I would like to setup git to launch different difftool executables (DiffTool Man-page) based on the file extension.

This could be done with an external script or executable. For example, here is a posted Q&A with a shell script that could do this: Git shell script for multiple difftools, however, my team uses primarily Windows, and this is a Unix solution, and I'd prefer a built-in solution.

Is there a way of doing something similar by having different [difftool] or [diff] sections in my global .gitconfig and using something like the .gitattributes file?

I'm currently using the .gitattributes method to unzip a specific file extension, that is an archive, before git diff's it. Can this method be extended to also launch a different DiffTool based on a different [difftool "mytool"] section in the .gitconfig?

Or, is there some other way to do this that is built-in to git?

0

There are 0 best solutions below