如何忽略git仓库中的PyCharm配置文件? [英] How do I ignore PyCharm configuration files in a git repository?

查看:349
本文介绍了如何忽略git仓库中的PyCharm配置文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想将我的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆