简体   繁体   English

在 WSL 下使用 Git Bash

[英]Using Git Bash under WSL

I need to use Git Bash (instead of the native Linux git ) under WSL .我需要在WSL下使用 Git Bash(而不是本机 Linux git )。

$ 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 命令,看来我需要覆盖

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输出仍然和以前一样:

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

How to override git --exec-path , or make the git alias work?如何覆盖git --exec-path ,或使git alias工作?

PS.附注。 the reason that I need to use Git Bash instead of the native Linux git is that the latter gives me:我需要使用 Git Bash 而不是本机 Linux git是后者给了我:

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

But I have to use schannel backend for my git to work.但是我必须使用 schannel 后端才能让我的 git 工作。

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:正如我在这个答案中提到的,在你的 WSL 会话中尝试使用 Linux Git:

git config --global http.sslBackend openssl

make sure that git version is 2.20 or more.确保git version是 2.20 或更高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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