简体   繁体   English

无法在WebStorm中克隆git存储库

[英]Cannot clone git repository in WebStorm

While setting up a dev environment on a new Windows 10 machine, I have run into the following issue - I cannot clone a remote git repository via WebStorm (both version 11.0.4 and 2016.2 - both evaluations). 在新的Windows 10计算机上设置开发环境时,遇到了以下问题-我无法通过WebStorm克隆远程git存储库(版本11.0.4和2016.2-均为评估版)。

The curious thing is that I can successfully clone using Windows command line on same machine and other people successfully clone the same repo with a similar setup using WebStorm on different machines. 奇怪的是,我可以在同一台计算机上使用Windows命令行成功克隆,而其他人可以在不同的计算机上使用WebStorm在相似的设置下成功克隆同一仓库。

Git is installed to default location ( C:\\Program Files\\Git ) using the default Windows presets, the cmd directory is on PATH, username and email are configured (I've even tried to generate SSH keys) - and, again, clone works as expected in command line. 使用默认的Windows预设将Git安装到默认位置( C:\\Program Files\\Git ),cmd目录位于PATH上,配置了用户名和电子邮件(我什至尝试生成SSH密钥)-再次克隆在命令行中按预期工作。

The URL of repo is [username]@[ip]:/var/www/git/[repo.git] (the repo lives on a local server). 存储库的URL为[username]@[ip]:/var/www/git/[repo.git] (存储库位于本地服务器上)。 This URL is successfully used in command line clone and from other machine's WebStorms. 此URL已成功用于命令行克隆和其他计算机的WebStorms。

WebStorm git settings are default, with correct path to git.exe (the one in cmd directory), and Test works. WebStorm git设置是默认设置,具有正确的git.exe路径(cmd目录中的一个),并且Test有效。 Attempts were made both using the Built-in and Native variants. 尝试使用“内置”和“本机”变体进行。

When trying to checkout in WebStorm, Test fails with Test repository failed . 尝试在WebStorm中检出时,测试失败, Test repository failed

When opening the repo that was cloned via command line and trying to update in WebStorm, these are the results: 当打开通过命令行克隆的存储库并尝试在WebStorm中更新时,结果如下:

Built-in mode:

16:26:06.446: cd [redacted]
16:26:06.446: git -c core.quotepath=false fetch origin --progress --prune
error: cannot spawn C:\Users\User\AppData\Local\Temp\git-ssh-0.bat: No such  file or directory
fatal: unable to fork

Native mode:

16:26:24.404: cd [redacted]
16:26:24.404: git -c core.quotepath=false fetch origin --progress --prune
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-with-mic,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

I have tried every voodoo magic I could think about (uninstalls, versions, UAC, processes, directories, PATH magic, etc.) and nothing managed to help. 我尝试了所有我能想到的巫术魔术(卸载,版本,UAC,进程,目录,PATH魔术等),但没有任何帮助。

Any help would be greatly appreciated - the next step on the list is Windows reinstall... :) 任何帮助将不胜感激-列表上的下一步是Windows重新安装... :)

In my case this was the deal: 就我而言,这是交易:

Webstorm was shooting an error about the file: intellij-git-ssh.bat . Webstorm正在射击有关文件intellij-git-ssh.bat When I tried to double click it - I got an error that the file was not found. 当我尝试双击它时-我收到未找到文件的错误。

Digging a bit further, I saw that this was the case for all bat file throughout the system. 进一步挖掘,我发现整个系统中的所有bat文件都是这种情况。 I had to verify that the system environment variable COMSPEC was set to: %SystemRoot%\\system32\\cmd.exe - it had some additional NodeJS suffxes that had no place to be there. 我必须验证将系统环境变量COMSPEC设置为: %SystemRoot%\\system32\\cmd.exe cmd.exe-它具有一些其他NodeJS后缀,没有后缀。

Re-opened the Webstorm - and voila! 重新打开Webstorm-瞧!

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

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