davidolrik / sublime-rsync-ssh

Keep remote directories in sync with local projects.
75 stars 33 forks source link

Allow sync in both directions #27

Open rnewton opened 9 years ago

rnewton commented 9 years ago

It would be useful to allow rsync back to the local directory on a hotkey or command. My current workflow allows me to edit locally, but all of the git information is stored on the remote machine so if I were to rebase/merge I can't get those changes locally unless I rsync the project manually.

This is a great plugin, btw.

davidolrik commented 9 years ago

I have thought about this feature many times, but I'm too afraid of accidental data loss when someone syncs from the remote and overrides local changes.

Why not have the .git locally as well?

rnewton commented 9 years ago

What if it was protected by a --dry-run flag by default or even had a confirmation before doing the sync? I don't see how any data loss could occur after you have to set the flag and confirm.

It's a bit of an odd git setup, to be fair. I have ssh keys setup on the remote, but not locally.

davidolrik commented 9 years ago

I'm not convinced, how often have you clicked OK on a dialog, and afterwards thought: "What did I just click OK to?"

You could use your development box as a jump host using ProxyCommand and ssh -W:

Host git.example.com
    ProxyCommand ssh -W %h:%p dev.example.com 2>/dev/null

This will let you perform all git commands command locally.

zjjott commented 9 years ago

I think it's a nice feature that it can sync from remote to local In my project,I have some compile task in remote server,and want to sync compile result to local.

Now I use SFTP+rsync ssh,the SFTP have some bug to upload file(trigger file change event when file has not uploaded ),rsync ssh can't download file....I think the solution no good enough..

davidolrik commented 8 years ago

Possible solution to this issue: #37.

hevisko commented 5 years ago

I have thought about this feature many times, but I'm too afraid of accidental data loss when someone syncs from the remote and overrides local changes.

It's one of those things: Backups, BACKUPS... check the backups

I have the need for the pulling, as I edit locally on both my Laptop (at client site) and my desktop (while working from home), and the pull is the way to get "fixes" I made on the remote back to the locals... but yes, I still do my git push/pull from the desktop/laptop.

ctheune commented 1 year ago

I'm pondering a "reverse" sync as well, for the reason of getting coverage output from test runs back locally. I'm siding with @davidolrik on the caution side and am wondering whether to implement the reverse sync in a way that you need to explicitly mark targets that you want sync and can thus make it as careful as you want to (like: only this directory and this file) ... how does that sound to you @davidolrik ?