2

私はgitが初めてです。SSH アクセスできるサーバー上にベア リポジトリを作成しました。それを自分のワークステーションに複製しようとすると、次の 2 つの異なる結果が得られます。

% git clone ssh://me@example.com:git/foo.git

Cloning into 'foo'...
ssh: example.com:git: no address associated with name
fatal: Could not read from remote repository.

しかし、を削除するとssh://、正常に動作します:

% git clone me@example.com:git/foo.git

Pro Git book によると、これらは同一である必要があります。

何を与える?

4

1 に答える 1

7
  • 最初のコマンドgit clone ssh://は標準に従うためSSH URI syntax、絶対パスを指定する必要があります。

    たとえば、これを試してください (ユーザーのホーム ディレクトリが にmeあると仮定します/home/me):

    git clone ssh://me@example.com/home/me/git/foo.git
    

    そして、これもうまくいくはずだと思います:

    git clone ssh://me@example.com/~/git/foo.git
    
  • 2 番目の構文:git clone me@example.com:git/foo.gitユーザーのホーム ディレクトリからの相対パスを使用できます。

于 2013-04-16T22:20:32.657 に答える