How to auto-configure git merge tool based on what is available on current machine?
I am working a many system and at least on some of them my home directory is stored on NIS, so I do share that same preferences.
I do want to write a small bash script which I can include inside
~/.bash_profile which will configure the best diff tool which is already installed on current machine.
- How to install gem from private GitHub repo using 'gem install' command
- Second checkout of the same local Git branch?
- Debugging Azure functions in Visual Studio
- Git tags referring to different refs on local and remote
- Git ls-remote and git update with Crowd authentication
- Why can't Bundler locate this gem?
The rule is simple, I have to check which command line diff tools are available and configure git to use the first one that I found.
Side note: On one linux machine I discovered that there is and ENV variable
__git_mergetools_common=$'diffuse ecmerge emerge kdiff3 meld opendiff\n\t\t\ttkdiff vimdiff gvimdiff xxdiff araxis p4merge\n' – I have no idea what is this used for, but it looks interesting.
One Solution collect form web for “How to auto-configure git merge tool based on what is available on current machine?”
Probably the easiest answer is to write a bash script that runs as the diff program, and selects the best available actual diff program each time.