2017-12-21 10 views
0

裸のgitリポジトリが存在するかどうか確認したいと思います。以下は私のMacでは動作しません。 ls-remoteコマンドは、私のリポジトリがリポジトリではないと言っていますが、cloneコマンドを使用すると複製できます。ls-remoteを使った裸のgitリポジトリのテスト

私は間違っていますか?

ありがとうございます!

repos> git init --bare --shared=all tmp.git 
Initialized empty shared Git repository in 
/Users/raysalemi/workspaces/install_mcs_project/repos/tmp.git/ 
repos> git ls-remote tmp.git 
fatal: 'tmp.git' does not appear to be a git repository 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 
repos> ls 
tmp.git 
repos> git clone tmp.git 
Cloning into 'tmp'... 
warning: You appear to have cloned an empty repository. 
done. 
repos> 

答えて

0

git ls-remoteは絶対パスでのみ動作します。

+1

'git ls-remote tmp.git'は' tmp.git'をリモートの名前として扱います。完全なパス名を含むURLを記入するか、リポジトリ内にあり、そのリポジトリの設定で定義されているリモートを使用することができます。 – torek

関連する問題