Should we ignore misc.xml and <projectFolderName>.iml in Pycharm .idea/ folder?

让人想犯罪 __ 提交于 2019-12-05 05:32:19

1) <projectFolderName>.iml - By default Idea editors produce <projectFolderName>.iml files which are place specific. To deal with it:

Rename a project:

Now you have two files in .idea dir: .name and YOUR_RENAMED_PROJECT.iml both of them are directory and platform independent and could be added to git.

2) misc.xml - TL;DR; ignore it

For PyCharm misc.xml may contain platform specific paths and even could ship more sensitive data.

3) Finally one has to rename a toolchain and use the same name across the team:

The best way to share your project files among a group of developers is to rename your project interpreter into something not dependent on your file system paths (e.g. "Python 2.7" or "My Project: Python 2.7 virtualenv") and then use that name consistently for all the developers.

You can rename your interpreters in "File | Settings | Project | Project Interpreter | | More... | Edit".

Source from PyCharm tracker

You need to use your own judgment based on circumstances.

misc.xml contains local environment specific information, for example project interpreter name, like this

<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (myvirtenvname)" project-jdk-type="Python SDK" />

Unless there is a strict shared virtual environments naming policy in the team, I would recommend ignoring it. I myself prefer no-one dictating me how I name my virtual environments on my dev machine. I might have many other projects and potential conflicting names.

The .iml and .name are addressed by the other answer. I do not like the fact though that the project interpreter name is here also bundled with all the project settings in the projecname.iml xml file. I wish it was more granular and in a separate file in the .idea folder so I can decide to share it or not. It is environment dependent and what interpreter to use might be better left to be decided by the individual. If jetbrains are reading this please consider.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!