我尝试了很多次但都失败了。我的步骤如下所示
在我的github上从cloud9添加SSH密钥,并将cloud 9与我的github连接
新的名为git@github.com:XXX/XXX.git
在云端9中输入文件
git remote add origin git@github.com:XXX/XXX.git
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!
答案 0 :(得分:0)
这是典型的在GitHub端创建的新回购非空(意思是README.md
或LICENSE
或......)
如果您尝试创建一个实际为空的GitHub仓库,您将看不到该错误消息,也不需要在git pull
之前执行git push
。