All files marked as Non-Project Files in Intellij after git clone

4,272

Solution 1

File -> Project Structure (Or press Ctrl+Alt+Shift+S)

Project Settings -> Modules

Select your project, and on the right you should have a list of content roots. roots

By default, it will be set as

  • Source Folders:
    • src\main\java
  • Test Source Folders:
    • src\test\java
  • Test Resources Folders:
    • src\test\Resources
  • Excluded Folders:
    • target

If that doesn't clear it up, you may need to adjust where IntelliJ thinks the project directory is in the settings.

Solution 2

Extremely late answer but I just ran into this for my project and realized that the name of my project had dashes like yours which is an invalid module name for IntelliJ. So I just changed the project folder name which solved my issue.

Share:
4,272
ZeRj
Author by

ZeRj

Programming for fun and living.

Updated on December 10, 2022

Comments

  • ZeRj
    ZeRj over 1 year

    After cloning a git repository with GitKraken (https://github.com/cloudwebrtc/flutter-webrtc) and opening it in Intellij it marks every file as "Non-Project Files" (Brown background).

    enter image description here

    Everything builds and runs as intended but it is kinda annoying.

    I tried git checkout using IntelliJ instead, but it didn't help.

    How can i fix this?