IntelliJ Git 集成 - git --version 空输出
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38867291/
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
IntelliJ Git Integration - git --version empty output
提问by rbrtl
I am currently trying to use the Git integration for IntelliJ 2016.2, but whenever I point it to the executable I get the following issue:
我目前正在尝试将 Git 集成用于 IntelliJ 2016.2,但是每当我将其指向可执行文件时,我都会遇到以下问题:
This doesn't technically prevent the integration from working but it does cause issues updating the index etc.
这在技术上不会阻止集成工作,但会导致更新索引等问题。
I'm running Windows 7, with a completely fresh install, but I had the same issue on the previous PC (these are work machines with various irritating levels of security) but I have colleagues with the same kit that have no such issues.
我正在运行 Windows 7,完全全新安装,但我在之前的 PC 上遇到了同样的问题(这些是具有各种令人恼火的安全级别的工作机器),但我有使用相同套件的同事没有这样的问题。
EDIT
编辑
I should have mentioned that it works fine on the command line:
我应该提到它在命令行上工作正常:
I'm sure I've read something about a change in the way this works internally that means when it's called by an outside executable the output gets screwed up, but I can't find the reference again.
我确信我已经阅读了一些关于内部工作方式变化的内容,这意味着当它被外部可执行文件调用时,输出会被搞砸,但我无法再次找到参考。
回答by user8208587
Make sure you set the right path to Git executable: IntelliJ > Settings > Version Control > Git should be C:/.../Git/bin/git.exe
确保为 Git 可执行文件设置了正确的路径:IntelliJ > 设置 > 版本控制 > Git 应该是 C:/.../Git/ bin/git.exe
Do not set git-bash.exe or git-cmd.exe
不要设置 git-bash.exe 或 git-cmd.exe
回答by Nagmon
Happened to me the exact same thing.
发生在我身上完全相同的事情。
git is working from the command line but the path:
git 正在从命令行工作,但路径:
C:\Program Files\Git\bin\git.exe
and the path (as the say here):
和路径(如这里所说):
C:\Program Files\Git\cmd\git.exe
(which is the path I got when I did where git.exe
in cmd)
(这是我where git.exe
在cmd中做的路径)
didn't work.
没有用。
So I went to git-bash and did where git.exe
, and I got a different path, which is working.
所以我去了 git-bash 并做了where git.exe
,我得到了一条不同的路径,这是有效的。
Hope it helps
希望能帮助到你
回答by Sai Gopi N
first get your git.exe path by using command. type this in cmd terminal
首先使用命令获取您的 git.exe 路径。在cmd终端输入这个
git --info-path
then find location your_directory\Git\bin\git.exe
mine was C:\Users\saigopi\AppData\Local\Programs\Git\bin
然后找到your_directory\Git\bin\git.exe
我的位置C:\Users\saigopi\AppData\Local\Programs\Git\bin
add this path in android studio
在android studio中添加此路径
File->Settings-> Version Control -> Git
文件->设置->版本控制-> Git
add your path at Path to Git Executableand test it
在Path to Git Executable添加你的路径并测试它
回答by phill.tomlinson
I had the same issue and tried a number of things. It eventually began working again when I downgraded my git install.
我遇到了同样的问题并尝试了很多东西。当我降级我的 git install 时,它最终又开始工作了。
- Close Intellij
- Uninstall git (my version was git version 2.10.1.windows.1)
Download an older version from here: https://github.com/git-for-windows/git/tagsI used this specific version: https://github.com/git-for-windows/git/releases/tag/v2.8.4.windows.1
Reload Intellij. Git should now work.
- 关闭 Intellij
- 卸载 git (我的版本是git version 2.10.1.windows.1)
从这里下载旧版本:https: //github.com/git-for-windows/git/tags我使用了这个特定版本:https: //github.com/git-for-windows/git/releases/tag/ v2.8.4.windows.1
重新加载 Intellij。Git 现在应该可以工作了。