I am switching to using Git for my projects and I generate my .gitignore file by going to gitignore.io page and entering my tech stack (for example, IntelliJ, Java).
This auto generates .gitignore file for IntelliJ and Java technologies and I paste this file in the root of my project like:
MyProject
- .idea
- fileA
- fileB
- ...
- .gitignore
However, I just opened my project and IntelliJ prompts me to add files to .idea folder. These files are:
I have 2 questions:
I got answer to this from JetBrains community at https://intellij-support.jetbrains.com/hc/en-us/community/posts/12550701430034-Why-is-IntelliJ-creating-a-gitignore-file-in-idea-folder-even-though-I-have-gitignore-file-in-my-project-root-and-should-it-be-ignored-or-committed-to-repository-?page=1#community_comment_12611700355346
TLDR: Yes, the .idea/.gitignore should be included in repo as it is used for ignoring some internal IntelliJ folders.
About the other files, information is in the link above