你好,我刚开始接触Git,并试图创建本地仓库,并提交了代码,但当我尝试使用推送命令时,它给出了以下错误:
SUMITs-Mac-mini:gitupload sumit$ git push -u origin master
To https://github.com/sumittiwari87/First-Gulp-Lesson.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/sumittiwari87/First-Gulp-Lesson.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
所以我尝试拉取提交更改,但是我又遇到了错误。
SUMITs-Mac-mini:gitupload sumit$ git pull origin master
warning: no common commits
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/sumittiwari87/First-Gulp-Lesson
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
fatal: refusing to merge unrelated histories
我不明白为什么会发生这种情况。