使用ls-remote测试裸git存储库

问题描述 投票:0回答:1

我想检查是否存在裸git存储库。以下内容在我的Mac上不起作用。 ls-remote命令说我的存储库不是存储库,但是clone命令允许我克隆它。

我究竟做错了什么?

谢谢!

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>
git
1个回答
1
投票

看起来git ls-remote只适用于绝对路径。

© www.soinside.com 2019 - 2024. All rights reserved.