设置 IntelliJ IDEA 和 Git

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19890618/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:20:18  来源:igfitidea点击:

Setting up IntelliJ IDEA and Git

gitgithubintellij-idea

提问by Jaz Brok

I'd want to integrate my repo, from GitHub to IDEA 13 (Ultimate).

我想整合我的 repo,从 GitHub 到 IDEA 13 (Ultimate)。

I set GitHub for windows. And clone my repo to local folder.
But when i try (in IDEA) use "Check out from Version Control", I have error message

我为 Windows 设置了 GitHub。并将我的 repo 克隆到本地文件夹。
但是当我尝试(在 IDEA 中)使用“ Check out from Version Control”时,出现错误消息

Executable is not specified

Of cos' in setting I successfully access to my github account.

cos' 在设置中我成功访问了我的 github 帐户。

Ok, I install git, from git-scm.com, and setup path to Git executable - git.exe.
And now, when I click "Check out from Version Control", error message is:

好的,我从 git-scm.com 安装了 git,并设置了 Git 可执行文件的路径 - git.exe.
现在,当我单击“ Check out from Version Control”时,错误消息是:

Error while executing git --version. Exit code...

How can I troubleshoot that new error message.

如何解决该新错误消息。

采纳答案by VonC

This error message comes from the GitVersion.java#identifyVersion()method(tested in GitVersionTest.java).

此错误消息来自GitVersion.java#identifyVersion()方法(在 中测试GitVersionTest.java)。

throw new ExecutionException("Errors while executing git --version. exitCode=" +
  result.getExitCode() +
  " errors: " + result.getStderr());

The error message can help, but you need to be sure that:

错误消息可以提供帮助,但您需要确保:

  • git.exeis in your PATHenvironment variable,
  • you have re-launched IntelliJ IDEA in order for it to inherit the updated PATH.
  • git.exe在您的PATH环境变量中,
  • 您已重新启动 IntelliJ IDEA 以使其继承更新的PATH.