Occasionally, it makes sense to use local and remote development tools simultaneously. Consider setting up a two-way file sync to ensure your project is in the same state, no matter where you run an operation. If you don't need to sync changes back from your Environment to the local machine, consider our one-way sync instead.
We're going to use Mutagen over SSH to establish the sync.
Login to Coder Enterprise and configure your local SSH client.
$ coder login https://coder.yourcompany.com 2020-10-20 11:16:29 SUCCESS Logged in. $ coder config-ssh An auto-generated ssh config was written to "/Users/ammar/.ssh/config" Your private ssh key was written to "/Users/ammar/.ssh/coder_enterprise" You should now be able to ssh into your environment For example, try running $ ssh coder.ammar
Create the sync
Note: The folder must exist on the remote server before beginning.
Identify your project directory and Environment name, then create the sync session.
$ cd ~/my-project $ coder envs ls Name ImageTag CPUCores MemoryGB DiskGB GPUs Updating Status ammar latest 4 4 30 0 false ON test latest 1 1 10 0 false OFF $ mutagen sync create . coder.env-name:~/project Created session sync_dLg9zfqynqVa9aj2V36Fr4OCMz1AHzTKzNGFYYkqfAI
Confirm it's working
mutagen sync monitor to check if the sync is working.
At this point, your project files should synchronize on any change.
Syncing all Projects
Mutagen performs quite well with many files and folders. We recommend settings up a sync between your projects directory and your Environment so you don't have to think about managing many sessions.
Pausing/Terminating Your Session
You can pause your sync with
mutagen sync pause or you can stop and delete the session using
mutagen sync terminate.