Configure PHPstorm and git on remote sources

I'm working on a project where the "working environment" is remote and I can connect to it using SSH or Samba. So I usually need to change the remote files and test. I was able to set a PHPstorm project by accessing the files via SFTP. Whenever I update a local file, it gets uploaded automatically, so it is ok.

The sources also stay in a git repository, so I have a clone on my local machine, connected to the local copy of the remote files.

When I change the branch locally (using external GIT software), the local files change correctly, but the remote files are not automatically updated. This makes the remote copy inconsistent and I can't test my changes in the remote "working environment".

If I try to access the remote files using Samba and edit them directly, I'm afraid it gets very slow and I can't use the git software any more (but the command line).

Can you please advice a better setup for the whole developing process?


I don't see any easy ways, unfortunately.

Way 1. On the branch change, you upload/sync everything to the remote SSH location. This will work, but if there are many files, it'd be a problem.

Way 2, if the first one is unusable. Switch the branch locally, apply changes, commit and push them, then go to the remote side, pull and switch the branch to make the local and remote locations synchronized.


I may not be understanding your workflow correctly, so apologies if this does not fit, but why not work locally then push your changes to your GIT server, then have a hook set up that automatically pushes the commit out to the remote via SSH? I have this set up on a couple projects on Bitbucket and it works really well.


@Scott Goddard Unfortunatelly I can't work locally, as I can connect to the DB only from the remote "working environment". I wish I could work locally :(


@Eugene Morozov I am currently using way 1, but I often need to upload more than 200 files. So I was hoping to find an easier way!


Please sign in to leave a comment.