New to phpStorm - Workflow Question

Hey, gang! So I finally pulled the trigger on phpStorm thanks to the great sale going on and so far, my only regret is not switching over sooner. I am, however, having trouble trying to figure out a workflow that worked well for me in NetBeans and I was wondering if anyone could give some insight.

My setup right now is a local checkout from Git on my laptop, with a remote dev server set (via ftps) for deployment on save. This seems to be fine and dandy until I need to change branches in Git. When I switch, it looks like the local files have updated correctly, but the remote server is not synced correctly. For example, files that exist in the first branch that don't in the second are still showing up in the deployment server, but not locally. I'm guessing there's a setting or something I'm missing here, but as I frequently switch branches, this is something I need to figure out asap.

Thanks in advance! Let me know if there are any further details I can provide.

8 comments
Comment actions Permalink

Hi there,

I'm not sure about this one, but worth checking: Tools | Deployment | Options --> Delete target items when source ones do not exist

Otherwise, you can always sync manually: "right click on folder(s)/file(s) in Project View | Deployment | Sync with Deployed..."

0
Comment actions Permalink

Thanks for the reply, Andriy! That checkbox under Deployment > Options seems to do the trick when I manually upload (right click > Upload to...), but it doesn't seem to be triggered when a branch has been switched. For the "Sync with Deployed" option, I can't find a way to make that one way (from local to my dev server). So it tries to download those files that are still on the server from the other branch. Doh!

Hopefully there's a way I can just switch the branch and have it deploy automatically?

0
Comment actions Permalink
For the "Sync with Deployed" option, I can't find a way to make that one way (from local to my dev server). So it tries to download those files that are still on the server from the other branch. Doh!

In Sync dialogue screen: select files, right click and choose desired action.

Hopefully there's a way I can just switch the branch and have it deploy automatically?

I'm not using any VCS myself, so cannot say for sure. But generally speaking it looks like a bug to me. Please check the Issue Tracker for any existing tickets and if nothing found then feel free to submit new one

0
Comment actions Permalink

Hello!

Andriy, thanks for help. Tools | Deployment | Options --> Delete target items when source ones do not exist doesn't affect autoupload, as it reacts on local filesystem changes. I.e. it uploads file when local file is created or changed, and deletes remote file when local one gets deleted. I guess current situation is related to this issue. By default autoupload listens only changes made by IDE. Changes made by VCS, or some other external thread, are ignored. Above-mentioned issue is about listening to VCS changes together with local, and current workaround is to enable Tools | Deployment | Options  --> Upload external changes.
Now to fix situation you'll have to upload whole project manually with Tools | Deployment | Options --> Delete target items when source ones enabled, or with cleat remote target folder.

Elena Shaverdova

0
Comment actions Permalink

Thanks for chiming in, Elena! If I'm understanding you correctly, it's currently not possible to perform a git checkout from inside of phpStorm (using it's built in git tools) and have that checkout automatically upload/deploy to the remote server adding and/or deleting files that exist on the remote. Correct?

0
Comment actions Permalink
Above-mentioned issue is about listening to VCS changes together with local, and current workaround is to enable Tools | Deployment | Options  --> Upload external changes.

Please try it

0
Comment actions Permalink

Sorry, I should have added that I did try that, however, it only appeared to upload new/changed files and did not delete removed files when changing branches. This makes the remote server a weird merge of the two branches.

0
Comment actions Permalink

Did you tried that over your existing "mess" on remote server (mix of two branches) ... or maybe you have cleared remote first as it was suggested ("Now to fix situation you'll have to upload whole project manually with Tools | Deployment | Options --> Delete target items when source ones enabled, or with clear remote target folder.").

If 2nd and it is still has the same behaviour after changing the branches, then I don't know ... manual sync only, I guess...

0

Please sign in to leave a comment.