git clone访问错误,指定目标目录

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

我正在尝试克隆(实际上是Bundler)指定目标目录的存储库:

git clone '[email protected]:org/repo.git' \
  "/home/maurizio/.asdf/installs/ruby/2.3.8/lib/ruby/gems/2.3.0/cache/bundler/git/repo-34ec47fae53fea1f1a83aa12476ce783204fcfef" \
  --bare --no-hardlinks --quiet

此命令失败,并显示以下错误消息:

Forbidden
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

因此,我尝试手动运行该命令,但出现相同的错误,除非我删除了目标目录:

git clone '[email protected]:org/repo.git' \
  --bare --no-hardlinks --quiet

作为一种解决方法,我正在手动克隆它并在克隆之后将其移动。

我的设置是默认设置;我为此项目只有一个替代的SSH密钥,另存为~/.ssh/id_rsa_org,可以正常工作。

git bundler
1个回答
0
投票

我认为您没有正确指定目标目录的路径,这就是它显示该错误的原因。而是尝试进入目标目录,在此打开终端并尝试git clone '[email protected]:org/repo.git' \ --bare --no-hardlinks --quiet

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