Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sync in both directions #27

Open
rnewton opened this issue Aug 17, 2015 · 7 comments
Open

Allow sync in both directions #27

rnewton opened this issue Aug 17, 2015 · 7 comments

Comments

@rnewton
Copy link

rnewton commented Aug 17, 2015

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
Copy link
Owner

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
Copy link
Author

rnewton commented Aug 17, 2015

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
Copy link
Owner

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
Copy link

zjjott commented Oct 4, 2015

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
Copy link
Owner

Possible solution to this issue: #37.

@hevisko
Copy link

hevisko commented Apr 2, 2019

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
Copy link
Contributor

ctheune commented Sep 8, 2023

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants