Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 550
ZeRj Avatar asked Apr 11 '19 10:04

ZeRj


People also ask

What are non Project files in IntelliJ?

Non-Project Files Protection dialog Such files are intentionally protected from modification. For example, it is not recommended that you change library classes as you are supposed to reuse them as is. If you want to work with these files, add them to the content root.

How do I fix Unversioned files in IntelliJ?

Open the Commit tool window Alt+0 . Put any files in the Unversioned Files changelist under version control by pressing Ctrl+Alt+A or selecting Add to VCS from the context menu. You can either add the entire changelist, or select separate files.

How do I Unstage files in IntelliJ?

You can also unstage a change in a file if you need to. To do that, you need to open the file that contains the change that you want to unstage from the Staged folder diff view. You can then use the >> arrows from the staged portion on the left-hand side to Unstage the change.

How do I mark a folder as source root in IntelliJ?

From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Project Settings | Modules. Select the necessary module and then open the Sources tab in the right-hand part of the dialog. Click Add Content Root and specify the folder that you want to add as a new content root.


1 Answers

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.

like image 189
Andrew Avatar answered Sep 28 '22 08:09

Andrew