“检测到未注册的 Git 根目录”,因为项目的父目录由 Git 进行版本控制

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19039306/
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-10 17:03:09  来源:igfitidea点击:

“Unregistered Git root detected” because parent directory of project is versioned by Git

gitintellij-ideamercurialpycharm

提问by Dun Peal

I set up a PyCharm project /parent/project, that is managed by Mercurial at /parent/project/.hg. Independently of this project, /parentis managed by Git at /parent/.git.

我建立了一个 PyCharm 项目/parent/project,由 Mercurial 在/parent/project/.hg. 独立于这个项目,/parent由 Git 在/parent/.git.

Unfortunately, this causes PyCharm to complain: "Unregistered Git root detected: The directory /parent is under Git, but is not registered in the Settings."

不幸的是,这导致 PyCharm 抱怨:“检测到未注册的 Git 根:目录 /parent 在 Git 下,但未在设置中注册。”

What's a clean solution for this? Ideally, I would like PyCharm to simply ignore any repos in directories above the project directory itself.

什么是干净的解决方案?理想情况下,我希望 PyCharm 简单地忽略项目目录本身上方目录中的任何存储库。

回答by Gregory Klimov

So far, IntelliJ supports only ignored files via http://www.jetbrains.com/idea/webhelp/configuring-ignored-files.html. I'm afraid it won't help you with parent folder, though. You may want to separate VCS roots to unrelated folders in this case.

到目前为止,IntelliJ 仅支持通过http://www.jetbrains.com/idea/webhelp/configuring-ignored-files.html忽略的文件。不过,恐怕它对父文件夹无济于事。在这种情况下,您可能希望将 VCS 根目录与不相关的文件夹分开。

回答by Eyal Sooliman

In Intelij idea: You need to open Project Settings->Libraries and clear all red colored libraries which are not valid. click OK and error will disappear.

在 Intelij 想法中:您需要打开项目设置->库并清除所有无效的红色库。单击确定,错误将消失。