git - 将新文件推送到新仓库

标签 git bitbucket

我正在尝试将一组现有文件推送到我创建的新私有(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 进行。

你可以做两件事

  1. 在您的计算机上设置 SSH key 并将其存入 bitbucket,以便我们识别您
  2. 将您的来源设置为 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/

相关文章:

bitbucket - 克隆到基本目录 git@bitbucket.org :myapp/configurations. git 发送 channel 请求失败

svn - 有没有办法使用bitbucket来fork一个subversion项目?

linux - 部署时限制文件 - git

bitbucket - 您如何使用 bitbucket 和 AppHarbor 部署和构建应用程序?

javascript - 权限被拒绝,forever.js 作为 bash 脚本?

git - 为 Github 私有(private)存储库验证 Jenkins CI

git - Gerrit 无法克隆

git - 来自 Bitbucket 的“Go Get”私有(private) repo

git - 如何在私有(private)存储库中使用带有依赖项的 Go 运行 Google Cloud Function?

git svn - cygwin 下的错误