I'd use rsync. It transfers only what changed. Like so:
rsync -e ssh -va remoteuser@remotehost:remotedir .
then edit the files locally at your own leisure. Zero lag. You get to inspect all the files before you commit them:
rsync -e ssh -va . remoteuser@remotehost:remotedir
I'm assuming you first create your local dir and cd
into that.
You can also make it handle the removal of files, but be really careful with that, because executing that in the wrong directory could nuke an entire directory tree.
rsync -e ssh -va --delete . remoteuser@remotehost:remotedir
What I do is I run it in "dry mode" first, using the 'n' flag, like so:
rsync -e ssh -van --delete . remoteuser@remotehost:remotedir
It will report what it would have done, if it were for real.
If I'm happy with the reported list, I run it again, and remove the 'n' flag.
rsync is very efficient. There are various other flags as well. It's quite sophisticated.
vim
is exhibiting lag, this probably points to an issue with your network rather than your workflow.ssh [email protected] vim /etc/somefile
(note the absence of;
).