tillberg / gut

Realtime bidirectional folder synchronization
ISC License
321 stars 23 forks source link

Add gut sync remote directories to local machine #12

Open microstacks opened 8 years ago

microstacks commented 8 years ago

@tillberg gut looks very promising for keeping the code in the cloud. is it possible to add support for copying remote directory to local machine, because upload bandwidth is limited and it takes time to do initial sync for large Github projects. Something like below.

gut sync remote@addr.com /path/to/local/dir

tillberg commented 8 years ago

@dupperinc I think that something like that actually should work currently (syntax below). When Gut initializes, it checks all the paths specified for existing gut repos. If there's only one already-existing repo, either locally or remotely, that repo gets initialized and cloned on the other host(s).

For example, if you had a folder, /home/remote/mydir, on addr.com, and you wanted to sync that to a new (empty) local folder, /home/local/somedir, then you should be able to do that with:

gut sync remote@addr.com:/home/remote/mydir /home/local/somedir

Gut will notice the existing repo in /home/remote/mydir, and the lack of any repo/files at /home/local/somedir/. It'll then do a gut init in the /home/local/somedir, then gut fetch the contents of /home/remote/mydir into it. (Or at least that's what I think should happen.)

microstacks commented 8 years ago

@tillberg the problem is reverse tunnel logic. gut is always trying to connect to localhost to fetch the changes. Gut is reporting connection fail for localhost, please see logs below.

[localhost:fetch] Fetching changes to localhost... [localhost:fetch] fatal: unable to connect to localhost: [localhost:fetch] localhost[0: 127.0.0.1]: errno=Connection refused [localhost:fetch] [localhost:merge] Merging changes to localhost... [localhost:merge] merge: origin/master - not something we can merge

Also is it possible to add SSH argument support for remote host?

microstacks commented 8 years ago

@tillberg any update on this one?