我在Github上创建了一个新的存储库,现在只有Readme.md文件。
我有一个新创建的RoR项目,我想将其推送到此存储库。以下是我在终端中给出的执行此命令的命令,以及我收到的错误。
git remote add origin https://github.com/aniruddhabarapatre/learn-rails.git
然后我输入了我的用户名和密码
git push -u origin master
错误--
To https://github.com/aniruddhabarapatre/learn-rails.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/aniruddhabarapatre/learn-rails.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 merge the remote changes (e.g.,
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
这是我第一次将我的代码推送到Github存储库,我对这些错误感到迷惑。我搜索了这里提出的其他几个问题,但它们都没有第一次出现问题。
https://stackoverflow.com/questions/20939648
复制相似问题