简体   繁体   English

通过WSL在pycharm中配置git

[英]configure git in pycharm through WSL

It seems like something went wrong when I set git inside pycharm like this:当我像这样在 pycharm 中设置 git 时,似乎出了点问题:

在此处输入图片说明

my git installed inside WSL is version-2.17.1;我在 WSL 中安装的 git 版本是 2.17.1; pycharm is professional version pycharm 是专业版

You can't directly invoke Linux programs from a Win32 program like this.您不能像这样从 Win32 程序直接调用 Linux 程序。 You may have better luck creating a batch file that invokes the wsl binary and use that.您可能会更幸运地创建一个调用wsl二进制文件并使用它的批处理文件。 Something like the following in the batch file may be useful:批处理文件中的以下内容可能有用:

wsl git %*

Then invoke your batch file as the Git binary.然后调用您的批处理文件作为 Git 二进制文件。

Do note that your Linux Git binary will expect Unix paths, not Win32 paths, so if you can't guarantee that Unix paths will be passed, you'll need to either switch both your editor and Git to be Linux programs, switch them both to be Windows programs, or not use Git inside your editor.请注意,您的 Linux Git 二进制文件需要 Unix 路径,而不是 Win32 路径,因此如果您不能保证 Unix 路径会被传递,您需要将编辑器和 Git 都切换为 Linux 程序,将它们都切换成为 Windows 程序,或者不在编辑器中使用 Git。

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

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