简体   繁体   中英

Using Git Bash under WSL

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

$ 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM