今天在上傳代碼到gitee上時庆寺,代碼上傳失敗蚊夫,提示錯誤:
To https://gitee.com/leaf777/imitating-jingdong-mall.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/leaf777/imitating-jingdong-mall.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.
即當(dāng)前版本低于倉庫版本,然后使用git pull語句進(jìn)行拉取懦尝,但是好像沒有成功知纷,終端提示
From https://gitee.com/leaf777/imitating-jingdong-mall
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
所以好像git pull語句在這個情況下不怎么好使壤圃,百度搜索后看見一個博主的解決方法:
使用:git pull --rebase origin master語句
git pull --rebase origin master
From https://gitee.com/leaf777/imitating-jingdong-mall
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: 第一次提交
可以看出來已經(jīng)成功下載了,接下來就使用 git push origin master正常提交了屈扎。
博客地址:https://blog.csdn.net/u013120247/article/details/53263169