How not to commit PyCharm configuration files to git repository
I don't want to commit my PyCharm config files (e.g. .idea/codeStyleSettings.xml) to my git repository, so I added the following to my .gitignore file:
.idea/
mydjangosite/.idea/However, every time I try to make a commit within PyCharm (command k), it still wants to commit these files. So I tried going to the Version Control node of the Settings dialog box, and updating the Ignored Files. I added both .idea directories above, and then went to commit and still saw the same PyCharm config file there ready to be commited.
So how do I get PyCharm to recognize either my .gitignore file, or the project settings?
请先登录再写评论。
Did you try tapping on the Refresh icon in the Changes panel? It works for me, though I use mercurial.
Thanks for the suggestion. Unfortunately it didn't fix the problem.
For me, adding this line works:
/.idea
For django projects i also have this line:
*.py[co]
Putting in /.idea causes PyCharm to interpret it as a folder in the root of my hard drive, which then appears as: ../../../../.idea/. So this doesn't work for me either.
Answered on StackOverflow:
http://stackoverflow.com/questions/9237345/how-not-to-commit-pycharm-configuration-files-to-git-repository/
Note: it's usually not needed to cross-post the question here and on StackOverflow.
I posted it here because it hadn't yet been satisfactorily answered on StackOverflow. Thank you for answer on SO though, it worked.
It would be helpful to find clear instructions somewhere which files to check in for saving what kind of configuration.