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

I set up a PyCharm project /parent/project, that is managed by Mercurial at /parent/project/.hg. Independently of this project, /parent is managed by Git at /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."

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



Solution 1:[1]

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.

Solution 2:[2]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gregory Klimov
Solution 2 Eyal Sooliman