作为我正在做的在线课程的一部分,我是 git 的新手。
目前正在做一个教程,当我第一次推送到 master 时收到以下错误消息:
$ git push -u origin master
To https://github.com/-/myappsample.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/-/myappsample.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.
我尝试了 git pull,但这也不起作用:
$ git pull https://github.com/-/myappsample.git master
From https://github.com/-/myappsample
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
这是一个全新的 Github 帐户,带有一个新的/空的 repo。
关于出了什么问题以及如何解决这个问题的任何想法?
谢谢