How do I ignore PyCharm configuration files in a git repository?


Question

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. How do I get PyCharm to recognize my .gitignore file and not commit these files?

1
46
12/6/2012 1:51:08 AM

Accepted Answer

If PyCharm offers you to commit the files, it means that you have already added them to Git. You need to remove them using 'git rm --cached' and commit the change. After that, they will be ignored by the integration according to your .gitignore settings.

70
2/13/2012 4:35:07 PM

You can configure ignored files.

Under the Version Control node, of the Settings dialog box, click Ignored Files. The Ignored Files dialog box opens.

More easily:

Tip

You can also add files to ignore list on-the-fly. A new file under the Unversioned Files change list, has Ignore command on its context menu.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon