【问题标题】:Getting 'Repository does not exist' when pushing from cloud9 toBitbucket从 cloud9 推送到 Bitbucket 时获取“存储库不存在”
【发布时间】:2016-09-28 21:24:29
【问题描述】:

在 Ruby on Rails 教程一书中,Micheal Hartl 建议使用 Cloud9 https://c9.io 云 IDE。我创建了一个 Bitbucket 帐户,在 IDE 上设置了 Git,并在 Cloud9 上安装了 Rails。

git push -u origin --all and getting error message conq: Repository does not exist.
fatal: could not read from remote repository
please make sure you have the correct access rights and the repository exist.

【问题讨论】:

  • 教程前面的那一行可能没有正确执行:git remote add origin git@bitbucket.org:<username>/hello_app.git。正如@Tito 提到的,您可以登录您的 bitbucket 帐户并在那里创建存储库(或至少检查它是否已创建)。
  • 谢谢。我看到 repo 是在 bitbucket 上创建的。问题是当我尝试将 rails hello.app 项目推送到 bit bucket 时。使用 git push -u origin --all

标签: ruby-on-rails


【解决方案1】:

登录 Bitbucket 网站并导航到仪表板。在概览选项卡上,您应该会看到类似“john_larkin / hello_app”的链接。单击该链接,您将看到此存储库的概述页面。在页面的右上角,您将看到一个 SSH 选择。您的存储库的名称显示在该选择的右侧。它应该类似于:

git@bitbucket.org:john_larkin/hello-app.git

在 hello 应用项目的 Cloud9 终端会话中,发出命令:

git remote add origin <repo>

&lt;repo&gt; 替换为您在 Bitbucket 中的存储库名称。

完成此操作后,您应该能够成功地将代码和更新推送到您的存储库。

SSH 密钥

如果您仍然遇到问题,请确保您已成功将 SSH 密钥从 Cloud9 IDE 加载到 Bitbucket:

  1. 转到https://bitbucket.org/
  2. 点击页面右上角的头像并选择“管理帐户”。
  3. 点击左侧面板安全性下的“SSH 密钥”链接。
  4. 您应该会在此处看到一个键 - 单击“编辑”链接(如果您没有看到键,请单击“添加键”按钮添加一个新键)。
  5. 在您的 Cloud9 IDE 上,单击屏幕顶部的头像并选择“仪表板”。单击屏幕右侧的“显示 SSH 密钥”以查看您的 Cloud9 SSH 密钥。此密钥应与 Bitbucket 编辑视图中显示的内容匹配。如果没有或您不确定,您可以随时删除此密钥并通过将 Cloud9 密钥复制到 Bitbucket 来创建新密钥。

【讨论】:

  • 谢谢史蒂夫,我这样做了,但我继续显示相同的错误消息。
  • 当您运行git remote... 命令时,您在终端中看到了什么?
  • 致命:存储库已经存在。抱歉,它说是致命的:远程来源已经存在
  • 听起来您的 SSH 密钥可能有问题。我已经更新了我的答案,包括在 Bitbucket 中检查和/或创建密钥的步骤。
  • 是的,我删除了那些 SSH 密钥并将它们复制回 bitbucket。没有运气同样的错误信息。呃。
【解决方案2】:

我在配置 C9 和 Bitbucket 时遇到问题,但经过战斗,我赢了。因此,对于我自己,我第一次只是删除了我的 repo 和我的应用程序,我才刚刚开始创建。如果不是您的情况,我不确定,但是如果您单击(左上角)选项以显示隐藏文件并删除 .git,那可能会有所帮助。

所以,我将列举我的步骤,使 C9 和 Bitbucket 之间的连接为我工作。

在 C9 中

  1. git config --global user.name "你的名字"
  2. git config --global user.email "email@exemple.com"
  3. git 初始化
  4. git add -A
  5. git commit -m "创建我的应用程序"
  6. cat ~/.ssh/id_rsa.pub (获取除电子邮件以外的所有 ssh 密钥)

在 Bitbucket 中

  1. 在 Bitbucket 设置中添加 SSH 密钥
  2. 创建存储库

在 C9 中添加 Bitbucket 代码示例

  1. git remote add origin git@bitbucket.org:(用户信息)
  2. git remote -v (看看是否正确)
  3. git push -u origin master

在这个阶段,应该全部推送到Bitbucket

再次将您的代码推送到 Bitbucket

  • git add -A
  • git commit -m "你的评论在这里"
  • git 推送

希望能帮助到一些人。

【讨论】:

    【解决方案3】:

    在从本地存储库推送之前,在网站中创建一个远程存储库。

    【讨论】:

      【解决方案4】:

      我也有这个问题。确保您使用

      向存储库添加了一些内容
      git add -A
      

      然后

      git add -m "Your message"
      

      然后尝试将存储库推送到上游。

      【讨论】:

        猜你喜欢
        • 2018-10-24
        • 1970-01-01
        • 2013-03-02
        • 1970-01-01
        • 2013-04-11
        • 2019-12-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多