如何忽略git仓库中的PyCharm配置文件? [英] How do I ignore PyCharm configuration files in a git repository?
问题描述
我不想将我的PyCharm配置文件(例如.idea / codeStyleSettings.xml)提交到我的git存储库,所以我将以下内容添加到我的.gitignore文件中:
.idea /
mydjangosite / .idea /
然而,每次我尝试在PyCharm(命令k)中进行提交时,它仍然想要提交这些文件。如何让PyCharm识别我的.gitignore文件并且不提交这些文件?
如果PyCharm提供您提交文件,这意味着你已经将它们添加到Git。你需要使用'git rm --cached'来移除它们并提交修改。之后,根据您的.gitignore设置,它们将被整合忽略。
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?
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.
这篇关于如何忽略git仓库中的PyCharm配置文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!