我在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存储库,但我迷失了错误。我搜索了这里提出的其他几个问题,但是第一次都没有问题。