0

I have a remote machine with very limited access. I cannot transfer files (I have to pass through a colleague who has physical access to the same subnet as the target machine). The version of git on my local machine is 2.17.1, the git version on the remote machine is 1.7.1.

I need to clone a git repo on from the local to the remote machine.

What I attempted so far

me@local$ git clone --bare /path/to/repo /path/to/bare.git

I zipped the bare repo, sent it to my colleague and had him load it in a directory to which I can access.

At this point I tried

me@remote$ git clone /path/to/bare.git /path/to/repo

but i got

fatal: /path/to/bare.git does not appear to be a git repository
fatal: The remote hang up unexpectedly

I did not despair and tried

me@remote$ git init /path/to/repo
me@remote$ cd /path/to/repo
me@remote$ git remote add origin /path/to/bare.git
me@remote$ git fetch

but still got the same errors as above.

What am I doing wrong?

1 Answers1

0

According to https://felipec.wordpress.com/2014/05/29/git-v2-0-0/, Git 2.0.0 was a backward-incompatible release, so I expect the problem is that Git 1.7.1 cannot read a Git repo created using 2.17.1.

Isolated networks are a pain, I know by experience. Can you install a newer version of Git there, possibly in user space? That might be your best bet if you can do it.

Counter opinion: one of the answers to Git version compatibility seems to say you should be able to read a Git 2.x repo using Git 1.7.

For what it's worth, your procedure seems sound and show work in theory, which is why I suspect incompatibility.

joanis
  • 10,635
  • 14
  • 30
  • 40