Skip to content

Instantly share code, notes, and snippets.

@vipulmathur
Last active February 5, 2024 10:24
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save vipulmathur/7d4f3dde35674874892ca61442fdf8f5 to your computer and use it in GitHub Desktop.
Save vipulmathur/7d4f3dde35674874892ca61442fdf8f5 to your computer and use it in GitHub Desktop.
Run PyCharm and IntelliJ IDEA on the same codebase

Problem

PyCharm and IntelliJ IDEA use the .idea directory to keep project information. While the two seem to be able to read each other's files, they (currently) don't understand the other's settings.

Solution

The work-around (till they learn to play better with each other) is to keep their .idea folders separate, while sharing a common project source tree. Instructions follow below.

Instructions

  1. Create space for keeping the source, and clone it.
$ mkdir -p ~/project/repos
$ cd ~/project/repos
$ git clone https://github.com/octocat/Hello-World
  1. Create two separate directories, one each for PyCharm and IntelliJ IDEA.
$ mkdir -p ~/project/ide/pycharm
$ mkdir ~/project/ide/intellij-idea
  1. Symlink the project repository inside each of the IDE directories.
$ cd ~/project/ide/pycharm
$ ln -s ~/project/repos/Hello-World
$ cd ~/project/ide/intellij-idea
$ ln -s ~/project/repos/Hello-World
  1. Create projects in each IDE, located at their respective folders. Open ~/project/ide/pycharm as a project in PyCharm, and import ~/project/ide/intellij-idea as a project in IntelliJ IDEA.

  2. Each IDE will create its own .idea directory.

$ ls -al ~/project/ide/pycharm/.idea
$ ls -al ~/project/ide/intellij-idea/.idea
  1. Both IDEs are now sharing the same project source tree, but not their own settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment