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