Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simultaneous programming on the same project in PhpStorm/IntelliJ IDEA

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.

like image 801
juzna.cz Avatar asked Mar 03 '12 11:03

juzna.cz


People also ask

How do I open multiple instances of the same project in IntelliJ?

Another way to open multiple editors for the same file is to select the file in the Project view and press Shift+Enter. Show activity on this post. Just for new people who navigate here. You could just drag & drop the code you want outside android studio.

Can you collaborate on IntelliJ?

With IntelliJ IDEA, you can use the Code With Me plugin that enables you to share your locally running project with anyone. You can use Code With Me for real time collaboration, editing code, sharing a server, and running a debugging session.

Can I run two instances of IntelliJ?

You can't because they're both one instance and one modal window blocks everything. If that was new instance, nothing you've done in the first could have affected the second.


1 Answers

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 :)
like image 196
zpontikas Avatar answered Oct 02 '22 11:10

zpontikas