0

PhpStorm 2023.3.3

When viewing a local PHP file we can compare differences to the remote (Server SSH access) file, and this difference split screen view highlights the differences between the local file and the remote file (on a live or testing server or whatever).

However, with all of these we can only ever implement the sections from the remote server to the local file, we can never implement taking specific parts of the local file up to the remote file.

We can only upload the whole file. Uploading the whole file always works fine.

Please see screen shot highlighting one example where we would like to add the if statement wrapper (out of shot) and the else {...} from the if statement (in shot).

enter image description here

We would expect to see a double arrow indicating we can upload this code block as we can for downloading the change (removing the local code block in this case).

How can we do this uploading?

1 Answer 1

1

Currently it's not possible, since in this diff view the remote side is treated as "read-only" (the "local code first, the remote is just a copy" approach).

https://youtrack.jetbrains.com/issue/WI-13462 -- watch this ticket (star/vote/comment) to get notified with any progress.

4
  • I'm sure this was possible on previous iterations of PhpStorm. Perhaps a couple years ago, tbh I can't remember when it was last required before this current project but I had a vague memory it was possible, but according to the ticket this hasn't been so. Are you aware of any way to enable this ability (changing server side file permissions or similar)? Thanks.
    – Martin
    Commented Feb 11 at 14:39
  • 1) It never was possible. It always was either "merge what you need to local" or "upload whole file to a remote" in this aspect. 2) It's not about server-side permissions. As I understand the diff viewer works with local files, and since remote in this case is just a "temp buffer", it cannot merge that way.
    – LazyOne
    Commented Feb 11 at 14:49
  • 1
    What you can do is: 1) Browse remote host (that panel) 2) Locate the file in question P.S. (may use "Navigate | Select in... | Remote Host" instead of #1 and #2 (depends on your setup ofc) 3) Now use "Edit Remote File". The IDE will download the remote file into some temp local file. You can now compare it with clipboard -- this way you can merge changes into a remote in small chunks. Once finished -- just upload that remote edit file. Yeah -- too many steps, not convenient. No better suggestion from me ATM.
    – LazyOne
    Commented Feb 11 at 14:54
  • that is indeed the current routine I use. Thanks.
    – Martin
    Commented Feb 11 at 15:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.