How I can turn off automatically add .idea files to git?

Answered

How I can turn off automatically add .idea files to git?

accidentally clicked the wrong word

0
6 comments

If you don't want to add .idea files to git, you likely want to ignore it. So just add the folder to .gitignore and the files will not be added to git anymore.

> accidentally clicked the wrong word

Do you mean the choice in the Project FIles Can Be Added to Git notification?

0
Avatar
Permanently deleted user

Я имею в виду что я во время первого запуска случайно кликнул чтобы по дефолту в новых проектах папка .idea добавлялась в гит. Думаю где-то есть системная переменная с надстройками пользователя которая отвечает за это, но я не смог ее найти.

В каждый раз вручную добавлять в .gitignore не хотелось бы

Да, вроде бы именно это уведомление и было.

0

Please use English on the public forum.

There is no setting in the IDE UI that controls this behavior - see https://youtrack.jetbrains.com/issue/IDEA-203061 

Frankly speaking, it does not seem necessary. As noted, if you do not want to track files in git, then you likely want to ignore it, because I really doubt that having unversioned files in the working tree is the desired behavior. So you will need to manually (or using action in the context menu) add .idea to gitignore anyway, as there is no logic to automatically ignore it.

If you never want to share .idea in git, add it to global gitignore. It is recommended to share project configs though.

0

To add, the choice is saved to worksapce.xml

So it is possible to manually remove the flag from there if you want. Look for the following:

<component name="PropertiesComponent">
    <property name="ASKED_SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
    <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />

 

0

No, there are good reasons to create, for example, a new Java class, but not want it added to git just yet. One reason is that you want to experiment or work with the file before telling git about it. It should remain as an untracked file until I remove it or tell git I want to add it.

0

After struggling to disable this feature for years, I think I finally found a solution: go to `File > New Projects Setup > Settings for New Projects...`, then just change the settings as posted in this screenshot and it should apply them to the new projects. I've just discovered that, hope that it actually works.

0

Please sign in to leave a comment.