Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is this git clone command failing?

Tags:

git

Trying to use the git clone command. My understanding (please correct if wrong) was that in order to host a Git repository you just need a machine running ssh and the project/repository sitting on it in a permitted location.

I have my git repository on an OS X system that's running ssh. I'm trying to clone it on a Windows XP system. I have Git Bash installed on the XP machine. In the Git bash (MINGW) console, I can ssh into the Mac no problem.

However, git clone fails...

$ git clone username@host:~/project/path/contactdb Initialized empty Git repository in    c:/Documents and Settings/Administrator/My Documents/projects/contactdb/.git/ bash: git-upload-pack: command not found fatal: The remote end hung up unexpectedly 

Tried it with and without .git extension:

$ git clone username@host:~/project/path/contactdb  $ git clone username@host:~/project/path/contactdb.git 

Do I need something else installed on the Mac?

like image 955
Ethan Avatar asked Jun 16 '09 01:06

Ethan


People also ask

Why is my git clone command not working?

If you have a problem cloning a repository, or using it once it has been created, check the following: Ensure that the user has gone through initial GitCentric login and has the correct username, email, and ssh. This should return a usage message that refers to the config-branch, config-repo, and ls-repo commands.


1 Answers

You need to have Git installed on the machine that has Git repository you want to clone; also git-upload-pack has to be in $PATH on remote machine when doing ssh. Do you get something like the following response when directly ssh-ing to remote machine:

$ ssh username@host git-upload-pack --help usage: git upload-pack [--strict] [--timeout=nn] <dir> 

or the following (wrong) response:

$ ssh username@host git-upload-pack --help bash: git-upload-pack: command not found 

(of course name of shell depends on what remote side is using).

What also might be problem (although perhaps not in your case) is having misconfigured remote machine so that uses interactive shell for ssh connection, either giving some messages on connection, or setting interactive variables like infamous $CDPATH environmental variable.

like image 163
Jakub Narębski Avatar answered Sep 25 '22 00:09

Jakub Narębski