Simultaneous programming on the same project in PhpStorm/IntelliJ IDEA

juzna.cz picture juzna.cz · Mar 3, 2012 · Viewed 8.7k times · Source

Is is possible in PhpStorm/IntelliJ IDEA for two (or more) programmers to work on the same project simultaneously, i.e. editing the same files at the same time? Imagine something like http://collabedit.com/, but in IDE.

When we start new projects, we would like a programmer and coder to sit to each other and edit the same files simultaneously, i.e. the programmer writes PHP code while the coder writes templates, both can look into each other's code and make some small changes where necessary.

We tried opening the same project via mounted drive on second computer, but Idea was confused and often happened, that the older version got flushed to disk and thus we lost our changes. Also, it's not possible to edit the same file simultaneously.

Answer

zpontikas picture zpontikas · Apr 29, 2014

Long story short you cant work like you do in collabedit.com in IntelliJ. ie. You cant see the other person typing the code on the same file that you have open....
Anyway the way to do it is to create a sync with a shared directory that both (or whoever you want) can access. Ok so here it goes....

  1. Go to "Project settings"

    (alt+ctrl+shift+s)

  2. Go to deployments and setup the info for the remote path that you want your developers to access simultaniously. If you this has an apache there you can add the server root path as well.
    Deployment connection settings

  3. Go to mappings and set the local folder that you want to sync with your remote folder. Note that: Local path should be the local root path of your project and deployment path on server is relative to the Root path you set on the previous tab (connections tab) Deployment mappings

  4. Go to Tools -> Deployment and check the Automatic upload (always)Tools deployemnts features

  5. Now Go to Tools -> Deployment -> Options and set the following marked settings Sync Options

  6. You can see now the deployment path that will be sync with your local files here. The green font indicates that this folder (or file) is linked to be synced with your own files. If you dont want a file or directory to be synced you can right click on it an select "exclude path" so it wont be synced. Deployment server



Ok so what have you acomplised with this setting?

  1. Whenever a file is localy changed it will be automaticly uploaded to the remote server/path
  2. If a file is changed on the server (by another dev probably) then this user will get a notification that this file changed.
  3. I think you can find your way from here and configure it the way you want to :)