如何将代码从cloud9推送到Github?

时间:2018-01-09 04:51:11

标签: git github cloud9

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

  1. 在我的github上从cloud9添加SSH密钥,并将cloud 9与我的github连接

  2. 新的名为git@github.com:XXX/XXX.git

  3. 的仓库
  4. 在云端9中输入文件

  5. git remote add origin git@github.com:XXX/XXX.git

  6. git push -u origin master​

  7. 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!
    

1 个答案:

答案 0 :(得分:0)

这是典型的在GitHub端创建的新回购非空(意思是README.mdLICENSE或......)

如果您尝试创建一个实际为空的GitHub仓库,您将看不到该错误消息,也不需要在git pull之前执行git push