codestream icon indicating copy to clipboard operation
codestream copied to clipboard

Using CodeStream when repo is on remote host

Open gabrielshanahan opened this issue 4 years ago • 3 comments

Hey everyone,

I'm using PHPStorm to work on code that resides inside a VM that runs locally (or to be more exact, a docker machine inside the VM). As such, I have git up and running inside the container, and PHPStorm mirrors the files on my physical drive, but there is no Git repo on my end. In such a scenario, I am unable to use CodeStream. The (obvious) workaround is to initialize the repository on PHPStorm's copy as well, but that presents a whole host of inconveniences.

The normal workflow is, I make a change in PhpStorm, that gets uploaded to the VM/docker repo, and at some point I commit in the VM/docker repo. But in this case, the same change remains uncommited in my local repo. The sync process is tedious: every time I commit any change, I have to push the changes to GitHub, reset my local (PHPStorm) branch, then pull from GitHub. To make matters worse, PhpStorm automatically propagates all changes, which causes a lot of redundancy. - when I reset my local branch, all my changes are (locally) deleted, which in turn starts the process of deleting all the changes in the VM/docker container. When I pull them, all those files get uploaded again. And sometimes things go wrong, in which case I have to go and run a checkout in the VM/docker container.

As you can see, this is very cumbersome, so I was just curious if there was another way. Working on a remote file system is a pretty common dev scenario.

Kind regards,

Gabriel

gabrielshanahan avatar May 07 '20 11:05 gabrielshanahan

Hi Gabriel

One possible solution is to install git in your dev environment but disable it in PhpStorm. As long as CodeStream is able to find git in the system path and the .git folder is accessible it should work. Would that work for you?

marcelofarias avatar May 07 '20 15:05 marcelofarias

I don't think that solves my issue. I still have to sync my local repository with the one in the VM/docker container, which leads to the inconveniences I described. PhpStorm's knowledge of the repository has no role in this - the same thing (minus the uploading of the changes) would happen if I used a text editor.

gabrielshanahan avatar May 07 '20 15:05 gabrielshanahan

I actually had an idea on how to solve this, and that is to have PHPStorm actually sync the .git/ folder. Albeit being a bit hacky, that might actually work, but unfortunately I couldn't test it because I ran into another unrelated issue along the way.

gabrielshanahan avatar May 07 '20 15:05 gabrielshanahan