【问题标题】:How to push the code from cloud9 to Github?如何将代码从 cloud9 推送到 Github?
【发布时间】:2018-01-09 04:51:11
【问题描述】:

​我尝试了很多次,但都失败了。我的步骤如下所示

  1. 在我的 github 上添加来自 cloud9 的 SSH 密钥并将 cloud 9 连接到我的 github

  2. 新建一个名为git@github.com:XXX/XXX.git的repo​

  3. 进入云9中的文件

  4. git remote add origin git@github.com:XXX/XXX.git​​

  5. git push -u origin master​

Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
    To git@github.com:XXX/XXX.git​
     ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'git@github.com:XXX/XXX.git​​'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Can some one help me? Thanks a lot!

【问题讨论】:

标签: git github cloud9


【解决方案1】:

这是在 GitHub 端创建的新存储库的典型特征非空(意思是 README.mdLICENSE 或...)

如果您尝试创建一个实际上是空的 GitHub 存储库,您将不会看到该错误消息,并且不需要在您的 git push 之前执行 git pull

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-06
    • 2017-11-04
    • 1970-01-01
    • 1970-01-01
    • 2011-07-17
    • 1970-01-01
    • 2018-04-23
    相关资源
    最近更新 更多