How can I fix this error when trying to install Oh-My-Fish?

0

I am using fish via Cygwin on Windows 10; whenever I try to install OMF, I am presented with this error:

curl -L https://get.oh-my.fish | fish.exe
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   194  100   194    0     0    194      0  0:00:01 --:--:--  0:00:01  2487
100 19025  100 19025    0     0  19025      0  0:00:01  0:00:01 --:--:-- 13379
Checking for a sane environment...
Install aborted: /cygdrive/c/Program Files/Git/cmd/git is Git for Windows which is not supported.

It implies that Git for Windows is not supported by OMF, but surely this isn't the case because I have seen several posts on GitHub that begin with something along the lines of:

After installing OMF on my Windows machine...

which implies that the installation was successful and thus can be achieved.

Is there a resolution to this?

SnookerFan

Posted 2018-11-22T12:42:50.630

Reputation: 872

You could put Cygwin Git in your PATH first. – slhck – 2018-11-22T14:16:05.153

How do I do that? As in, I know how to add things to my PATH - what I want to know is how to specifically put Cygwin Git in my PATH. I'm running Cygwin setup again and am now adding the git packages that way. Is that the right approach? Also, I'm not sure if it's relevant, but I already use Git through Cygwin/fish. – SnookerFan – 2018-11-22T14:23:13.397

The Git you are using is the one installed with the Git for Windows installer. When you install Git via Cygwin, you will get another git executable (probably at /usr/bin/git or somewhere similar). Which one you use for your daily work does not really matter. They may just differ in terms of functionality. You may even continue using the Windows Git; but for the installation of oh-my-fish, you could probably override the path temporarily, so that it'll continue. – slhck – 2018-11-22T15:22:11.103

PS: From my own experience, having a mix of Cygwin and Windows executables (Git, Python) is a little bit confusing but manageable. Just make sure you know which one you are calling. – slhck – 2018-11-22T15:23:02.057

Thank you for the comments. I finished installing the Git packages via Cygwin and it worked! – SnookerFan – 2018-11-22T16:50:16.087

Answers

0

The Git you are using is the one installed with the Git for Windows installer.

When you install Git via Cygwin, you will get another git executable. Which one you use for your daily work does not really matter. They may just differ in terms of functionality or compatibility (e.g., the Windows Git comes with some shell extensions for Windows Explorer).

Once you have installed Git via the Cygwin installer, check your Git executables:

which -a git

This will list the order of preference. For the installation of oh-my-fish, make sure that Cygwin Git comes first (/usr/bin/git), so that it'll continue with the installation.

You can then switch back to whatever Git you want to use for your daily work by overriding the path, e.g. by adding this to your shell profile:

export PATH="/cygdrive/c/Program Files/Git/cmd/:$PATH"

slhck

Posted 2018-11-22T12:42:50.630

Reputation: 182 472

This is helpful, thank you. As per my comment in the original question, I finished installing Git via Cygwin and it now works. I ran which -a git and got this (I have denote a new line with ;): /bin/git; /usr/bin/git; /cygdrive/c/Program Files/Git/cmd/git. However, after installing OMF, it significantly slowed down the CLI, so I have removed it for now but will look into why that happened another time. – SnookerFan – 2018-11-23T09:19:15.693

Thanks for the additional info. I don't have Windows to test here. If this answer solved your problem, I'd appreciate if you marked it as accepted. – slhck – 2018-11-23T14:03:43.237