Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

My google search give me this thread which leads us to Pycharm official site here saying that we should KEEP all except workspace.xml, tasks.xml

Though I see that files misc.xml and <projectFolderName>.iml also contains local/physical path pointing to a sub folder in my user home in Ubuntu.

So I confused and brought it up here - should we git ignore those two files too?

like image 329
Nam G VU Avatar asked Jul 26 '16 12:07

Nam G VU


People also ask

Should you ignore the .idea folder?

You shouldn't ignore the idea folder. you're supposed to commit almost all of it to the repo.

Should idea folder be committed?

As of year 2020, JetBrains suggests to commit the . idea folder. The JetBrains IDEs (webstorm, intellij, android studio, pycharm, clion, etc.) automatically add that folder to your git repository (if there's one).

What is idea Workspace xml?

The workspace. xml file stores personal settings such as placement and positions of your windows, your VCS and History settings, and other data pertaining to the development environment. It also contains a list of changed files and other sensitive information. These files should not be present on a production system.

What is idea Folder Pycharm?

idea folder (hidden on OS X) in the solution root contains IntelliJ's project specific settings files. These include per-project details such as VCS mapping and run and debug configurations, as well as per-user details, such as currently open files, navigation history and currently selected configuration.


2 Answers

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

Rename a project:

enter image description here enter image description here

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

like image 174
MajesticRa Avatar answered Jan 04 '23 08:01

MajesticRa


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.

like image 37
predmod Avatar answered Jan 04 '23 08:01

predmod