VSCODE remote editing, download-on-open option? - visual-studio-code

I am mostly editing files remotely in VSCode, and have tried several sftp extensions. ftp-sync has been the best so far, but there is one nagging problem that hopefully someone has solved: Upload-on-save is great and works perfectly, but I'd like to Download-on-open also (with bonus points for warning if the file is different). I sometimes edit the remote files on the remote server, and because there's no check in vscode on open, it's easy to lose those changes. Anyone run into this and have suggestions for a different extension that works this way?

A recent release on March 19th of https://github.com/liximomo/vscode-sftp has added support for this functionality with downloadOnOpen. It works perfectly for my use case (if there's an updated version of the file on the server, download and use that). The UX is a little rough still, but will surely improve over time.
If you're using git locally, there's very little chance of losing local changes, so this works perfectly for the case where you want to edit and manage files locally, but stay in sync per-file with a remote ssh/sftp server.

Look into the Remote VSCode plugin. It doesn't do FTP-like navigation, but if you use SSH, you can tunnel an editing session over the connection into VSCode pretty easily. It felt a little wonky at first, but I use this plugin constantly. As I work across a fleet of a few hundred servers, this option made a lot more sense than trying to set up some of those "deploy" plugins for each host.

Check This Extension on VSCode.Its really awesome.
Remote WorkSpace

Related

Why do not extensions with a remote work area work?

I have started using "VsCode" as a text editor for my projects in php. I usually work in remote servers so I need another application to download the files and edit them, like "Filezilla".
Today he discovered the extension "Ssh fs" (https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs) that what he does is create a work area with connection to the server and work directly on it, everything from "VsCode".
The truth is that it works very well.
The problem is that I have some extensions installed (like a code formatter, etc) and when I connect to the server they do not appear and I can not use them.

Eclipse Auto-Upload on Save, Without Aptana

I'm using Eclipse to develop a website, and I don't want to run Apache, PHP, and MySQL on my local computer. I already have a remote Linux server set up to do that. What I want though, is every time I save a file, Eclipse should upload that file to the Linux server. Dreamweaver does an absolutely perfect job at this task, but I prefer many other features in Eclipse.
I am well aware that there are many, many posts on Stack Overflow about this topic. I have reviewed them, but none seem to quite meet my needs. I'll go through all the possibilities I know about, and talk about why they're not quite right:
Aptana - I specifically excluded this in the question's title. Yes, it does what I'm asking for, but if you install it as an Eclipse plugin, it totally takes over your Eclipse. I only want this one feature, not the whole 800-pound gorilla that changes everything.
Remote System Explorer - I want the primary version to be on my hard drive, not the remote server. This is because I want faster file open, and code completion.
GIT or SVN - When I see other people ask this question on Stack Overflow, someone usually answers "use Git or SVN." Well, I'm already using Git. When I want to sync the entire project, and not just iterate on one file, I will do it using Git. But standalone Git is way too slow if all you want to do is see your changes working. I also don't want to see hundreds of meaningless commits. PTP, mentioned below, is a little better and a little faster, but not fast enough.
PTP - This is an Eclipse plugin that not too many people seem to know about. It has the ability to sync a local folder and a remote folder using Git, and it can do it automatically every time you hit save. This is absolutely awesome, but unfortunately a little slow. When I hit save in Dreamweaver, the change is uploaded to the server in less than one second. The PTP Git operation takes 10 seconds on a tiny project, and I bet that wait gets larger with a larger project. I'm a huge believer in super-fast iteration, and all that PTP waiting will really slow me down.
WebDAV and FTP support for Eclipse - It seems like this is no longer actively developed.
FileSync - Pretty neat, but only supports local filesystem folders.
Are there any other options that I've overlooked? Or are my requirements so specific that there's nothing that fits me right. It seems like there would be other people who want exactly the same thing.
This is my suggestion and it is not quick way to do this, but very customizable.
In eclipse you can set external tools.That means, you can set a php/java script file as external program and send some params that eclipse gives you(${resource_loc} ${project_name} ${resource_path}).
So with script file you can login to SSH or FTP or what ever you want and sync your file or project with remote system.
Just in External Tools Configuration window in eclipse you must set Location to /usr/bin/php
and in Arguments, you can set script path with eclipse variables as script args.
At last you should assign some short key to external program IF Possible.
Did you consider set up Samba server on your Linux and work on you local computer but store project in remote directory served by Samba from Linux or use mentioned FileSync to sync local working directory with network directory (which for Windows look like local and thus FileSync should work).
Or Dropbox?
Edited:
You are constrained heavily I see. Maybe you have on remote host rsync? You could write small utility to manage if your local folder changed (for Windows: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365261(v=vs.85).aspx) and then synchronize folders with rsync via ssh (https://www.digitalocean.com/community/articles/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps). This would be completely independent from Eclipse.
you can have a try with CodeSync #github (I write it)
or this one
https://github.com/zhwj184/remotedeploy
Now I am in 2021, and most of the above methods cannot work at all.
Finally, I find a small plugin in Eclipse that is very easy to upload the files (may be not auto-load, but is very easy).
Install the "Alibaba Cloud Toolkit" plugin in Eclipse Marketplace;
Using the right-click "deploy" item to deploy the selected files/directory to the remote directory.
There is also a problem. In my eclipse, the inside Terminal is blank (for all terminals including local terminal and SSH terminal), the blank terminal
But the terminal in RSE is ok.
The terminal in RSE
I also tried to uninstall Alibaba Cloud Toolkit, CDT, TM Terminal, etc.
But the inside terminal does not work anymore.
So I use the terminal in RSE now and put its view, as I just want to run my code on the remote server.

Team foundation server on the Mac with Vim

I'm using Vim on a Mac for front-end development and was recently hired at the company that uses Team Foundation Server as their version control system.
I would hate to have to switch to using Visual Studio on Windows because I'm so used to Vim and the Mac.
I found this and was hoping that would be a possible solution. I would still like to avoid editing code in Eclipse. However I wouldn't mind opening Eclipse to do version control stuff.
I'm very unfamiliar with Eclipse and Team Foundation Server (not VCS in general) and I need some advice on how to actually use it.
I'm able to connect to the server and find the project I have to work on, but from here I'm lost. This is the window I'm stuck at.
Anyone who are in a similar situation and could offer some help?
You've done the hard bit I think, firstly you should be able to safely ignore the Work Item and Build "folders" unless someone explicity tells you to use work items, at which point they can show you what you need to know as it works exactly the same as in Visual Studio.
If you double click on the Source Control folder it will open a new window which will show you the source "tree". To be able to Get, Checkout and add source files to the tree you'll need to set up a workspace. Once you've done this then you can get the code and check out.
With Team Explorer Everywhere You also have the option of using the tf command line in the Mac terminal. This would eliminate the need for eclipse. (I'm assuming that as a Vim user you're not afraid to use the terminal)
Another option might be svnBridge however I think you need the server version if you're using a Mac, and this requires a site to be installed in the TFS application server which might not be an option.
Finally TFS now offers support for integration with GIT.

How can I utilize source control when my working copy needs to be on a shared host without SSH access?

I'm trying to develop a little toy PHP project, and the most convenient location to run it is on a shared host I happen to have for my ill-maintained blog. The problem with this is that I have no way to run Subversion on this shared host, nor do I even have SSH access to be able to access an external repository from the host. Had I been thinking straight a few months ago when the hosting was up for renewal, I probably should have paid a couple extra bucks to switch to something a bit better, but for now I can't justify throwing money at having a second host just for side projects.
This means that a working copy of my project would need to be checked out to my laptop, while the project itself would need to be uploaded to the shared host to run. My best option seems to be creating a virtual machine running Linux and developing everything from in there, but I know from past experience that the extra barrier that creates, small though it may be, is enough that it puts me off firing the VM up just to do a couple minutes work to make some minor change I just thought up. I'd much prefer to just be able to fire up my editor and get to work.
While I'd imagine I'm not the first to encounter such a problem, I haven't had much success finding a solution online. Perhaps there isn't one beyond the VM or "manual mirroring" options, but if there is I'd expect StackOverflow to be the place to find it.
Edit: There's some confusion, it seems, so let me attempt to clarify. The shared host here is basically my dev server, but it has no svn or ssh. In other words, I can svn checkout to my laptop, but I can't run that on my shared host. Similarly, I can run/test my code on the shared host, but I can't do that on my laptop (well, I technically could, but it's Windows, and I don't want to worry about Win-vs.-Linux differences with PHP, since I do want this to become public at some point, and it will certainly be Linux-based at that point).
You might consider writing a post-commit hook to automatically upload the code to your host, so that any time you commit a change, a script executes that:
Checks out a copy of the code into a temporary directory
Uploads that code via FTP (or whatever your preferred method is) to the shared host
Cleans up after itself, optionally informing you via e.g. email when the transfer is successful
Subversion makes enough information available to these scripts at runtime that you could get more sophisticated and opt only to upload the files that changed or alter behavior based on specific property changes, for instance, but for a small project the brute force "copy it all" approach should be fine.

Best way to synchronize my code between multiple workstations?

Firstly, I'm not sure if this belongs here or programmers. Please move if it needs to be there.
I am mostly a hobbiest web developer, with a bit of freelance sidework. I program anywhere I can, from a laptop on the go to my home PC. I've pretty well settled on Net Beans as my IDE, and xampp for my test environment. My question is how do I best synchronize changes between my different PCs?
I started out FTPing changes to a "dev" area on my webserver, then FTPing them down to my other PC, but that's sort of a pain. Lately I have started using dropbox, which takes a lot of the pain out, but still isn't quite as seemless as I'd like.
Has anyone come up with a bulletproof way to easily ensure you're always opening up the latest version of your files across multiple PCs which aren't necessarily always (but sometimes are) on your home network?
Free is a necessity.
I personally use Subversion.
It integrates easily with Netbeans or Eclipse, and you say you've got a webserver, which I presume is Linux based? It's easy to set up in any Linux environment, though I think it can also be set up in a Windows environment.
Then you just run an update on your code when you want to get the latest version, do checkins when you like it, and you can always go back to earlier code (like if you tried a two day experiment that didn't work out and now want to delete it all and go back to what you had that was working).
Use some version control system. If you are new to this stuff Subversion would be probably the easiest to start with and it is very well intergrated with Netbeans.
You may set up repository on your own server or use some external service - there are a lot of them and almost everyone offers some free plan to start with. I'd be glad to give you some pointers if you like.
Learn to use a version control system.
www.github.com is free for open source projects, but must pay for private source repositories and also closed source projects, hurray.
http://unfuddle.com uses subversion, and is free for 200Mb of private source.
You may find some of the links in this thread useful.
A very simple and efficient way is to open an account on dropbox.com.
I disagree with a lot of the answers here (A lot are pretty old). Git/SVN is not a synchronization solution (nor a backup). It is just a version control system. (But if done correctly you can use git and a sync tool at the same time.)
By using git for synchronization you get the following side effects:
polluted git log: e.g. git commit -am 'synced files'... 'synced files again', 'synced from laptop', 'synced from desktop'
a substandard workflow: every time you leave your workstation or laptop you have to remember to git commit and push. This takes time and mental energy
Instead, I would recommend a solution that offers a continuous sync of your files to a central server. You can close your laptop within five seconds (maybe less) and your changes are propagated to a central server awaiting to sync to other devices when they come online. One priviso: you need to make sure you are not syncing folders like .git so a sync from your laptop .git for your project doesn't corrupt your .git on your desktop. Some options are:
Synology Cloudstation Drive - I can speak personally to this one. It excludes all "." files by default, and syncs at every file change. As soon as you save the file it is synced
NextCloud/OwnCloud - I now use Nextcloud, sync all computers, and make sure to exclude .git so that each git repo will track independent changes against origin BUT still be synced between devices.
Google Drive
Dropbox
You can set up a web-based source repository on something like http://www.github.com, and be able to access it from any computer.