Project file changes are polluting my changelist
My IDEA changes project settings files quite often (probably because I am frequently using newer IDEA versions than my colleagues) (for example misc.xml or run configurations).
In earlier versions I just put those file in a specific changelist (".idea") once and ignored them.
However in 2018 due to the partial commit feature, it is not enough to move the project settings file to another changelist once. Next time it changes, the new changes are back in my "real", active changelist.
So I may accidentally commit project settings changes that are not (yet) meant to be shared.
Is there a way to "pin" all changes in the files in ".idea" to a specific changelist or any other way not to mingle them with whatever changelist might be currently active?
Please sign in to leave a comment.
Hello,
I couldn't reproduce the issue with sample project. Do every commit suggest to also commit project configuration files?
Strange.
With 2018.1 every change in any file goes into the currently active changelist, even if the same file is already present in another changelist.
Now, when I cause any project file to change (for example changing the project's inspection profile), then the change will be in my active changelist.
When I commit, yes, of course, all changes in the active changelist - including project settings - are by default included in the commit.
With the current concept of partial commits how should it work differently?
Indeed, with new partial changelists new changes always get assigned to the active changelist. Ability to pin a file to a changelist might be useful, however, it needs a careful consideration. But again this would only a workaround for the issue,
The real problem here is that there is no way to tell IDEA to ignore files already tracked by git. I could think of several workarounds;
1. You could probably mark the files using
A drawback - files will not be listed as changed even if you make some changes you do want to commit unless you again mark them with --no-skip-worktree flag.
2. Move the .idea folder out of the current repo, e.g. by creating a special sub-repo for hosting the folder, and un-register it when you don't need to track changes in there. This will, however, affect all users.