1

I need to use Git Bash (instead of the native Linux git) under WSL.

$ type git.exe
git.exe is hashed (/c/Program Files/Git/mingw64/bin/git.exe)

The trouble is, I'm getting:

$ git.exe alias list
git: 'alias' is not a git command. See 'git --help'.

From Expansion of alias failed; not a git command, it seems that I need to override

git --exec-path

But having done

export GIT_EXEC_PATH='/c/Program Files/Git/mingw64/libexec/git-core'

The git --exec-path output is still the same as before:

$ git --exec-path
C:/Program Files/Git/mingw64/libexec/git-core

How to override git --exec-path, or make the git alias work?

PS. the reason that I need to use Git Bash instead of the native Linux git is that the latter gives me:

$ git pull
fatal: Unsupported SSL backend 'schannel'. Supported SSL backends:
        gnutls

But I have to use schannel backend for my git to work.

UPDATE:

Just want to point out that all the recommended solutions are not the answer to this specific question, and hopefully such note "will help prevent your question from getting closed and will remove the suggested questions notification from your post". Thank you all though, for all the answers so far

xpt
  • 20,363
  • 37
  • 127
  • 216
  • Probably better fix the real `git` instead. Perhaps see https://stackoverflow.com/questions/45742607/switch-to-native-windows-secure-channel-library-from-openssl-library-on-wind – tripleee Nov 10 '20 at 05:36
  • Does this answer your question? [Switch to "Native Windows Secure Channel library" from "OpenSSL library" on Windows Git, without reinstalling?](https://stackoverflow.com/questions/45742607/switch-to-native-windows-secure-channel-library-from-openssl-library-on-wind) – tripleee Nov 10 '20 at 07:59

1 Answers1

0
$ git pull
  fatal: Unsupported SSL backend 'schannel'. Supported SSL backends:
         gnutls

As I mentioned in this answer, try in your WSL session, with the Linux Git:

git config --global http.sslBackend openssl

make sure that git version is 2.20 or more.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • setting http.sslBackend to "openssl" will allow Git for Windows to choose the SSL backend at runtime. Will it work for Linux Git as well? My git version is 2.20.1, why it says "Supported SSL backends: gnutls" without mentioning "openssl"? – xpt Nov 10 '20 at 15:48
  • @xpt Upgrading Git (the Linux one) would be a good idea (to 2.29.2). If it can choose its SSL backend at runtime, it should pick gnutls. – VonC Nov 10 '20 at 16:08
  • Honestly, I think that's the wrong direction, as I believe git-bash, i.e., Git for Windows, has many specific tweaks to make it works with schannel backend. Normal git would not work. As a proof, I've tried the git under mysys2, and it is not working for my case -- MS TFS/git server. – xpt Nov 11 '20 at 14:47
  • @xpt OK. I usually uses Git for Windows or Linux Git (WSL). – VonC Nov 11 '20 at 14:48
  • @Mark What version of Git are you using, with which OS? – VonC Jan 31 '21 at 12:41
  • @VonC git is already the newest version (1:2.25.1-1ubuntu3). using WSL2 with Ubuntu – Mark Jan 31 '21 at 12:42
  • @Mark 2.25? That is old ;) (2.30 would be the latest, but would need to be compiled for that Ubuntu distribution). Can you ask a separate question illustrating your issue? – VonC Jan 31 '21 at 12:43