我正在尝试将现有的一组文件推送到我创建的新私人仓库。我以前做过这个,但今天我得到的输出与平常不同。
推送后,我收到以下消息:
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
问题,我该如何解决这个问题?
答案 0 :(得分:2)
git@bitbucket.org/
表示将使用SSH密钥与bitbucket进行通信。
你可以做两件事
https//(UserName)@bitbucket.org:renovationlabs/cloudcode.git
。这样就可以使用与bitbucket的https通信。Bitbucket解释了如何设置ssh密钥:
https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html