jedbrown / git-fat

Simple way to handle fat files without committing them to git, supports synchronization using rsync
BSD 2-Clause "Simplified" License
620 stars 136 forks source link

git fat pull from mac to linux #75

Closed dktanwar closed 7 years ago

dktanwar commented 7 years ago

I am trying to perform git fat pull, to pull git-fat objects from a MacPro to Linux. Its failing with following error

rsync: on remote machine: -sRe.LsfxC: unknown option rsync error: syntax or usage error (code 1) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-51/rsync/main.c(1337) [server=2.6.9] rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.2]

Both machines have same version of rsync

jedbrown commented 7 years ago

Which version of rsync? Can you try calling rsync without git-fat?

dktanwar commented 7 years ago

rsync version on both machines: 3.1.2

Also, I have tried using directly rsync to copy from Mac to Linux and vice versa. and rsync did it's job

jedbrown commented 7 years ago

Okay, run

GIT_FAT_VERBOSE=1 git fat pull

(or whatever). This will output (among other things) the exact command that was constructed for rsync. If I were to make a blind guess, perhaps it has to do with case sensitivity in your file system path.

dktanwar commented 7 years ago

OK.

So I think there is no problem with git-fat

$  git fat pull
rsync: on remote machine: -sRe.LsfxC: unknown option
rsync error: syntax or usage error (code 1) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-51/rsync/main.c(1337) [server=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.2]
dktanwar commented 7 years ago

If you have any idea to solve this issue, please let me know.

jedbrown commented 7 years ago

If you run GIT_FAT_VERBOSE=1 git fat pull then you'll get more output. In particular, you'll see exactly what options are being passed to rsync and may be able to narrow it down. I'm going to assume this is not actually a git-fat problem -- please reopen if you find evidence that git-fat is at fault.

dktanwar commented 7 years ago

You are right! It's not git-fat problem. It's rsync problem, which come pre installed with Mac. Problem is, even having installed newest version of rsync, on mac machine, it's still picking up the developer version. I tried to overcome this issue, but unable to.

dktanwar commented 7 years ago
$  GIT_FAT_VERBOSE=1 git fat pull
rsync: on remote machine: -sRe.LsfxC: unknown option
rsync error: syntax or usage error (code 1) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-51/rsync/main.c(1337) [server=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.2]
jedbrown commented 7 years ago

You should see something like this:

Pulling from localhost:/tmp/fat-store
Executing: rsync --progress --ignore-existing --from0 --files-from=- localhost:/tmp/fat-store/ .git/fat/objects/

You could either uninstall the Apple version or make sure the correct path is used. There is --rsync-path=/path/to/rsync (see the rsync man page).

PauloPhagula commented 5 years ago

@dktanwar the solution I used, in the end, was

  1. disable macOS system integrity protection.
    1. check if its enabled first with csrutil status
    2. If enabled, restart into Recovery Mode by pressing Cmd-R on boot
    3. Open terminal and run csrutil enable
    4. Restart computer into normal mode
  2. Rename /usr/bin/rsync to /usr/bin/rsync.bak with cd /usr/bin && mv rsync rsync.bak
  3. Symlink Homebrew's rsync to /usr/bin with ln -s /usr/local/bin/rsync /usr/bin/rsync

This, of course, screams insecure, insecure, insecure!