vscode-sftp icon indicating copy to clipboard operation
vscode-sftp copied to clipboard

Feature request, diff on save / diff on upload.

Open AdamJonsson opened this issue 6 years ago • 14 comments

A new features what many would appreciate is the option to diff on upload. A feature that more or less checks if the file on the server have changes after the project was dowloaded.

Maybe it could be done by, when saving, downloading the file that is going to be saved from the server. Compare it with the local one (Before saving the file). If there is no difference between the files, save the file and upload it. If there is a difference, cancel the save and show a warning and the diff panel between the local and the remote file.

AdamJonsson avatar Jun 26 '18 18:06 AdamJonsson

Yep, that's exactly what I need. That's very useful when you work in team and several person editing the same file.

mrjackphil avatar Jul 02 '18 10:07 mrjackphil

Went back to phpstorm just because of this. Im waiting this to be added and im back on vscode. Please add! Thank you.

kaidoj avatar Jul 18 '18 19:07 kaidoj

@AdamJonsson Does phpstorm support this?

liximomo avatar Jul 19 '18 01:07 liximomo

@liximomo Yes they do. It is located under: Default Preferences -> Build, Execution, Deployment -> Deployment -> Options. There they have a setting that is called: "Warn when uploading over newer file" and also "Notify of remote changes".

image

However, I have no idea how they are doing it. An easy fix may just to compare the timestamp or size.

AdamJonsson avatar Jul 20 '18 04:07 AdamJonsson

I would love this feature as well.

Thanks!

Ranchman42 avatar Sep 26 '18 16:09 Ranchman42

Any update about this feature? I believe you already have all neded parts ready, so we would just need an option like "diffOnUpload".

It would run the diff command you already have before the upload. And then in case files will be same upload will be done, otherwise it will fail/stop with warning.

dadavec avatar Feb 15 '19 07:02 dadavec

in ftp-kr it is. Only broke after updating vscode. Very useful thing!

AndryWJ avatar Feb 17 '19 14:02 AndryWJ

I was using it before, but since it broke up I was looking for some alternative. This one is very close and this feature is the only one I am missing.

dadavec avatar Feb 17 '19 15:02 dadavec

in ftp-kr it is. Only broke after updating vscode. Very useful thing!

+1 only with option "autoDownload": true works in vscode 1.37.0-insider

autoDownload (boolean) It will check modification of every opening and download if it modified (default: false)

ildarkhasanshin avatar Jul 13 '19 23:07 ildarkhasanshin

Detecting changes automatically between local and remote is missing to this extension. Is it possible one day ?

And a configuration to automatically download from remote an open file from the local explorer would be a real advantage.

Every SFTP extension is missing something major like this.

If someone guide me, maybe I could try to do it ?

Lospepes avatar May 13 '20 13:05 Lospepes

Detecting changes automatically between local and remote is missing to this extension. Is it possible one day ?

And a configuration to automatically download from remote an open file from the local explorer would be a real advantage.

Every SFTP extension is missing something major like this.

If someone guide me, maybe I could try to do it ?

Absolutely I agree. I use SASS extension and when save style.scss file, i have to save style.css file too.

cihankaba avatar Mar 18 '21 00:03 cihankaba

+1, diff before upload on save before overwrite newer files

Even Dreamweaver has it built in. (In combination with an external tool like WinMerge)

I come from HomeSite and have been using DreamWeaver for pure coding (yes;) ever since and I would very much like to switch to VSC. This is one of two features that I sorely miss compared to the DW. (Or I haven't found it yet.)

Here newer files are completely overwritten without warning. This is dangerous. Why compare manually every time before the upload when you can automate it?

If the remote file is newer, then at least ask for "diff or overwrite"

MJ

Pudelwerfer avatar Jul 28 '21 08:07 Pudelwerfer

+1 I'm simultaneously using using your stfp extension and ftp-kr. Close to disabling this extension. ftp-kr throws the diff on the screen and gives the option "upload" or "download" when there is a difference when using autoUpload

gimjudge avatar Mar 29 '22 20:03 gimjudge

Hi guys. Any news about this? I'm also very keen on having it. I recently had some issues where I destroyed a few important code updates I did on another laptop and I forgot about them, so it's quite vital in some cases.

SomeDevWeb avatar Jan 09 '24 14:01 SomeDevWeb