在WSL下使用Git Bash [英] Using Git Bash under WSL

查看:166
本文介绍了在WSL下使用Git Bash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 WSL 下使用Git Bash(而不是本地Linux git ).

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)

麻烦是,我得到了:

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

来自别名扩展失败;不是git命令,看来我需要重写

git --exec-path

但是做完

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

git --exec-path 输出仍然与以前相同:

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

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

如何覆盖 git --exec-path 或使 git别名工作?

PS.我需要使用Git Bash代替本地Linux git 的原因是后者给了我

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

但是我必须使用schannel后端使我的git正常工作.

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

更新:

仅需指出,所有建议的解决方案都不是该特定问题的答案,希望这样的注释将有助于防止您的问题被关闭,并从您的帖子中删除建议的问题通知"..尽管如此,谢谢大家

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

正如我在此答案中提到的那样,请使用Linux Git在您的WSL会话中尝试:

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

git config --global http.sslBackend openssl

确保 git版本为2.20或更高版本.

make sure that git version is 2.20 or more.

这篇关于在WSL下使用Git Bash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆