Git 将新文件推送到新的repo

Git 将新文件推送到新的repo,git,bitbucket,Git,Bitbucket,我正在尝试将一组现有文件推送到我创建的新私有回购协议。我以前做过,但今天我得到的输出与平常不同 一推,我得到了以下信息: Warning: Permanently added the RSA host key for IP address '131.103.20.168' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please

我正在尝试将一组现有文件推送到我创建的新私有回购协议。我以前做过,但今天我得到的输出与平常不同

一推,我得到了以下信息:

Warning: Permanently added the RSA host key for IP address '131.103.20.168' to the list of known hosts.

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
首先,我注意到设置新回购的说明已更改为使用
SSH
而不是
HTTPS
来推送回购:

cd /path/to/my/repo
git remote add origin git@bitbucket.org:renovationlabs/cloudcode.git
git push -u origin --all # pushes up the repo and its refs for the first time
git push -u origin --tags # pushes up any tags

现在我遇到了这些警告和错误。这是一个
SSH
问题,我如何解决这个问题?

这个
git@bitbucket.org/
表示将使用SSH密钥与bitbucket进行通信

你可以做两件事

  • 在您的计算机上设置SSH密钥并将其保存到bitbucket,以便我们能够识别您
  • 将您的origin设置为类似于
    https/(UserName)@bitbucket.org:renovationlabs/cloudcode.git
    。通过这种方式,您可以使用https与bitbucket通信
  • Bitbucket在此解释如何设置ssh密钥: