I installed Git-Bash but I won't be able to access all the tools(vim,vimdiff) that I can access with Cygwin. Can that be set in one of the Git config files?
3 Answers
You might just need to add the cygwin bin directory to your $PATH variable in git bash.
Despite what everyone else seems to think they know, Git Bash is actually pretty much repackaged Cygwin. Viz: https://github.com/msysgit/msys/tree/master/winsup/cygwin

- 719
- 4
- 18
Git bash, and related tools in msysgit package, are pure Windows executables.
That's why you cannot run Cygwin tools into Git bash, since these are not completely windows programs (they need the cygwin.dll
, see @fvu comment below).
If you want to use Git with Cygwin tools, you have to install the git package for Cygwin.

- 5,002
- 1
- 23
- 35
-
Cygwin-compiled programs are Windows programs, but they depend on an emulation of certain POSIX features as provided by the cygwin dll. More info [here](http://stackoverflow.com/questions/771756/what-is-the-difference-between-cygwin-and-mingw). But that doesn't change your conclusion. – fvu Jul 01 '13 at 21:48
-
1Then why is it possible to run Cygwin tools from cmd.exe (which is a pure Windows executable), but not Git bash? – Claus Conrad Jan 23 '15 at 17:09
-
Then why is it possible to run Cygwin `rsync` from Git Bash, after I added `C:\cygwin64\bin` to the `PATH` environment variable? See answer below by Keith Tyler. – Amedee Van Gasse May 27 '19 at 13:51
If you add theCygwin bin
directory to your $PATH
variable in git bash, make sure to use Git 2.27 (Q2 2020).
Utilities run via the run_command()
API were not spawned correctly on Cygwin, when the paths to them are given as a full path with backslashes.
See commit 05ac858 (27 Mar 2020) by Andras Kucsma (r0mai
).
(Merged by Junio C Hamano -- gitster
-- in commit d01b722, 22 Apr 2020)
run-command
: trigger PATH lookup properly on CygwinSigned-off-by: Andras Kucsma
On Cygwin, the codepath for POSIX-like systems is taken in
run-command.c
::start_command(). Theprepare_cmd()
helper function is called to decide if the command needs to be looked up in the PATH. The logic there is to do the PATH-lookup if and only if it does not have any slash '/' in it. If this test passes we end up attempting to run the command by appending the string after each colon-separated component of PATH.The Cygwin environment supports both Windows and POSIX style paths, so both forwardslahes '/' and back slashes '\' can be used as directory separators for any external program the user supplies.
Examples for path strings which are being incorrectly searched for in the PATH instead of being executed as is:
"C:\Program Files\some-program.exe" - "a\b\c.exe"
To handle these, the
PATH
lookup detection logic inprepare_cmd()
is taught to know about this Cygwin quirk, by introducinghas_dir_sep(
path) helper function to abstract away the difference between true POSIX and Cygwin systems.

- 1,262,500
- 529
- 4,410
- 5,250