Search code examples
synchronizationdevelopment-environment

How can I synchronize my code to a remote machine using ssh?


For a current course I am taking, we are using a remote computer to run our code.

I am coding locally on my MacBook and I'm looking for a good way to keep my local code up to date on the cluster.

The way I was doing it was to have a terminal open for running SCP to copy the directory, and another terminal that was SSH-ed into the cluster for making and running my code.

This seems less than optimal for me. Is there a way that I could automate the sending of the files to the cluster when they are modified?

Or am I stuck with the one-line command to move everything?


Solution

  • If you can use rsync, that would probably be the best way.

    Would using sshfs to (fuse) mount the remote folder(s) be an option? You could either edit the files directly, or use rsync, unison or any folder to folder synchronisation tool then.