I agree with the other answers' general analysis and am also unable to predict exactly what kind of conflicts you could run into. I know I haven't noticed anything awry myself taking the third option. But I can add a little to what the options actually do as of 2018.
I experimented with a variety of installation configurations while deciding how to suggest my team transition to git, including these options. This is what I actually observed the installation doing to my path, as of git for Windows v2.19.1.
Use Git from Git Bash only
As it states, no modifications are made to your system's path. Entering a simple git status
on the Windows command prompt, cmd.exe, will fail with 'git' is not recognized as an internal or external command, operable program or batch file
.
Use Git from the Windows Command Prompt
Can I just change the order of the directories in the PATH to prevent conflicts?
Is this what the 2nd option does? ("Use Git from the Windows Command Prompt -- This option is considered safe as it only adds some minimal Git wrappers")
Changing the order is always an option for you, but no, the second choice appears to have nothing to do with ordering. (Path additions seem to go to the end of the path regardless. I'm a little suspicious this changed at some point.) It's a question of which directories are added to the path, and is different between the second and third options.
When it says it will add "minimal" Git wrappers to your PATH, what it appears to actually do is add the cmd
folder of the (coming) installation to the path. This is the option I eventually suggested to my team. We now have C:\Program Files\Git\cmd
on our paths.
What's in the cmd
directory? For me, only six files:
- git.exe
- git-gui.exe
- gitk.exe
- git-lfs.exe
- start-ssh-agent.cmd
- start-ssh-pageant.cmd
As with Anaksunaman's answer, I'm not sure when this would not be enough. Any of the normal commands starting with git <some command>
would work from the inclusion of git.exe.
Use Git and optional Unix tools from the Windows Command Prompt
This includes the second option's adding <Install dir>\Git\cmd
to the path, and also adds <Install dir>\Git\mingw64\bin
and <Install dir>\Git\usr\bin
to the path. Both directories have a significant number of executables, including find, sort, and kill as mentioned in other answers.
Rather than listing what's probably a couple hundred items, I'd encourage the concerned user to take option two, complete the installation, and go take a look at those directories. If you're satisfied with the risk, adding <Install dir>\Git\mingw64\bin
and <Install dir>\Git\usr\bin
to your path yourself would be equivalent to taking a time machine back and selecting the third option.
Best Answer
At the current time you must set the registry options beforehand if you want to do so. The Chocolatey package does this based on package parameters you pass to the install command:
or
That said, if you want to get it as an argument, the Git for Windows folks are very accepting of Pull Requests. If you have the InnoSetup installer experience, please contribute at git-for-windows/build-extra.
More Information
If you are curious to see how it works, inspect the files section of the package page and
tools\chocolateyInstall.ps1
and you will see the following: