【问题标题】:Can't clone bitbucket repo locally无法在本地克隆 bitbucket 存储库
【发布时间】:2020-12-13 18:02:47
【问题描述】:

我为我的帐户设置了 SSH 密钥。

当我在终端运行 git clone 时,我通常会收到 Forbidden fatal: could not read from remote repository。

运行 ssh-add -l 显示正确的经过身份验证的代理。
运行 git clone 现在要求输入我的密码并显示上述错误消息。
说“请确保您拥有正确的访问权限并且存储库存在。”

我运行ps 以确保只有一个经过身份验证的代理

clone 命令是git clone git@bitbucket.org:<filepath>.git

【问题讨论】:

  • 请发送克隆命令。您可能使用了 http 而不是 ssh
  • 我添加了 git clone 命令。虽然不是 https

标签: bash github bitbucket git-clone


【解决方案1】:

网址应该:

  • 不是git@bitbucket.org:<filepath>.git
  • 但是git@bitbucket.org:<account>/<projectname>.git

你可以使用:

export GIT_SSH_COMMAND='ssh -Tv'

您将看到 SSH 正在使用哪个密钥。
确保公钥是registered to your Bitbucket account settings

但是 OP 补充说:

这是私人的,我不是所有者。所有者是否需要使用访问设置更新某些内容?

那么是的,您的帐户needs to be granted access in that repository by its owner

【讨论】:

  • 我的 ssh 密钥已添加到我的 bitbucket 帐户设置中。我的坏。克隆 URL 是 git@bitbucket.org:/.git
  • @ocom 是私有仓库吗?您是否拥有该存储库?
  • 它是私人的,我不是所有者。所有者是否需要使用访问设置更新某些内容?
猜你喜欢
  • 1970-01-01
  • 2020-01-14
  • 1970-01-01
  • 2021-02-22
  • 2016-05-01
  • 2016-02-05
  • 2017-03-25
  • 2014-10-11
  • 1970-01-01
相关资源
最近更新 更多