我正在尝试将一组现有文件推送到我创建的新私有(private)存储库。我以前做过,但今天我得到的输出与平时不同。
推送后,我收到以下消息:
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/
意味着与 bitbucket 的通信将使用 SSH key 进行。
你可以做两件事
- 在您的计算机上设置 SSH key 并将其存入 bitbucket,以便我们识别您
- 将您的来源设置为
https//(UserName)@bitbucket.org:renovationlabs/cloudcode.git
。这样您就可以使用 https 与 bitbucket 进行通信。
Bitbucket 在这里解释了如何设置 ssh key :
https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html
关于git - 将新文件推送到新仓库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33589104/