Detect and compare installed Git version against vendored Git (#1658)

* Replaced the git version comparison mechanism with actual version comparing
* Add notes regarding the git comparison method

Added a simple mechanism to call and compare the user installed git version against the vendored git version, rather than checking if the `git.exe` executable is located in a `/bin` directory.

This fixes false warnings by actually testing if the user installed git is older, or more recent.

Added a small note regarding how the `init.bat` works, and where to put custom `git.exe` binaries as well as where to find the Minified Cmder.
This commit is contained in:
David Refoua
2018-02-22 22:50:08 +03:30
committed by Jack
parent cf311fb1c2
commit 8237b1010c
2 changed files with 131 additions and 9 deletions

View File

@ -147,10 +147,16 @@ Note: These are loaded in this order by '$ENV:CMDER_ROOT\\vendor\\user-profile.p
### SSH Agent
To start SSH agent simply call `start-ssh-agent`, which is in the `vendor/git-for-windows/cmd` folder.
To start the vendored SSH agent simply call `start-ssh-agent`, which is in the `vendor/git-for-windows/cmd` folder.
If you want to run SSH agent on startup, include the line `@call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"` in `%CMDER_ROOT%/config/user-profile.cmd` (usually just uncomment it).
### Vendored Git
Cmder is by default shipped with a vendored Git installation. On each instance of launching Cmder, an attempt is made to locate any other user provided Git binaries. Upon finding a `git.exe` binary, Cmder further compares its version against the vendored one _by executing_ it. The vendored `git.exe` binary is _only_ used when it is more recent than the user-installed one.
You may use your favorite version of Git by including its path in the `%PATH%` enviroment variable. Moreover, the **Mini** edition of Cmder (found on the [downloads page](https://github.com/cmderdev/cmder/releases)) excludes any vendored Git binaries.
### Using external Cygwin/Babun, MSys2, or Git for Windows SDK with Cmder.
1. Setup a new task by pressing '<kbd>Win</kbd> +<kbd>Alt</kbd> + <kbd>T</kbd>'.