5

git clone gituser@<server>:myRepo.git doesn't work, fails with the error message:

fatal: ''myRepo.git'' does not appear to be a git repository

Background:

We have a Windows 7 machine set up with Git Bash and Bitvise WinSSHd (on C:). The SSH server is set up to use <git dir>/bin/sh.exe --login as the shell, with the home directory set to /a/. I can SSH onto the server just fine, and it drops me into the Git Bash shell as expected, starting in the /a/ directory.

I have a bare repository at /a/myRepo.git (on the A: disk) which does everything it should, as long as we're doing it locally. I can git clone /a/myRepo.git, work on it, push and pull, no problems as long as it's local (or "local" over SSH). Furthermore, we set up the A: disk as a shared folder, and I can clone, push, and pull from a local network machine using \\<server>\myRepo.git.

When I try to clone remotely, however, I cannot figure out what combination of options will allow it to work: The obvious clone string doesn't work, putting an absolute pathname in either *nix-converted format (/a/myRepo.git and A:/myRepo.git) or Windows format (A:\\myRepo.git) fails with the same error, the permissions on the directory are set up to allow all users, and I've set git config core.sharedRepository all on the serving machine as well.

I had a suspicion of Git Bash's remapping of Windows drive letters into /<letter> format, but I tried creating another bare repository on C: and it gives me the same error message.

1 Answer 1

0
  1. Read about supported by Git protocols and format of URLs
  2. Use correct, unambiguously interpreted URL for the repository: while you use SSH and URLS seems as SSH, it resembles more format of SCP. I.e - starting point in path part isn't $HOME, but root of your ssh-server

I'll expect ssh://gituser@<server>/~/myRepo.git have to work (formally, besides some possible additional unrelated to ssh problems)

3
  • The full string, including protocol and path name didn't work. Adding the protocol interprets things between : and / as a port.
    – wersimmon
    Mar 30, 2013 at 4:17
  • @harbichidian - mea culpa, URL corrrected. git-scm.com/docs/git-clone#URLS used as reference Mar 30, 2013 at 6:20
  • Tried .../~/myRepo.git, .../a/myRepo.git, and .../myRepo.git. None worked, all returned the same error with the host and initial slash stripped in the message (''~/myRepo.git'' does not appear...).
    – wersimmon
    Mar 30, 2013 at 15:31

Not the answer you're looking for? Browse other questions tagged .