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?

7 comments
Comment actions Permalink

Did you try tapping on the Refresh icon in the Changes panel? It works for me, though I use mercurial.

0
Comment actions Permalink

Thanks for the suggestion. Unfortunately it didn't fix the problem.

0
Comment actions Permalink

For me, adding this line works:

/.idea

For django projects i also have this line:

*.py[co]

0
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0
Comment actions Permalink

I posted it here because it hadn't yet been satisfactorily answered on StackOverflow. Thank you for answer on SO though, it worked.

0
Comment actions Permalink

It would be helpful to find clear instructions somewhere which files to check in for saving what kind of configuration. 

0

Please sign in to leave a comment.