Skip to content

Instantly share code, notes, and snippets.

@qlibp
Forked from vipulmathur/PyCharmIntelliJShared.md
Created August 31, 2022 03:23
Show Gist options
  • Save qlibp/c44ed07710b5e84312e156c8009b756c to your computer and use it in GitHub Desktop.
Save qlibp/c44ed07710b5e84312e156c8009b756c 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