infinity
infinity

Reputation: 1

Unable to chdir() on Git/Cygwin

I installed Git via Cygwin on Windows Server. It works out very well. However there's a small issue that when I clone a repo use the command as following:

$git clone git@myserver:project.git

I always get the following error:

fatal: '/project.git': unable to chdir or not a git archive

but if I typed in the full path then it works

$git clone git@myserver:/home/git/repositories/project.git

Did anyone here face this problem before?

Regards, TL

Upvotes: 0

Views: 435

Answers (1)

mipadi
mipadi

Reputation: 411270

By default, git clone uses SSH as the transfer protocol. When connecting over SSH, you have to specify the full path to the repository -- you cannot use a relative path like project.git.

If the machine storing the repos instead uses git daemon to serve the repos, and you connect via the Git protocol, then you can specify base path for the repos using the --base-path=path flag for git daemon.

Upvotes: 2

Related Questions