Why is this git clone command failing?

后端 未结 9 2122
挽巷
挽巷 2021-02-03 23:40

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 t

9条回答
  •  花落未央
    2021-02-04 00:01

    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] 
    

    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.

提交回复
热议问题