簡體   English   中英

Git錯誤:! [拒絕] master -> master(非快進)

[英]Git error: ! [rejected] master -> master (non-fast-forward)

我正在更新我的項目,當嘗試將其上傳到我的存儲庫時,出現以下錯誤:

已經做了

git pull --rebase origin master

  ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://*******/production.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.

我需要更新我的網站,但無法這樣做。

編輯 1:

> git status給出:

正在變基; 到 cda02b2 您當前正在將分支 'master' 重新設置為 'cda02b2'。 (修復所有沖突:運行“git rebase --continue”)

無需提交,工作目錄干凈

正如 git 在輸出中告訴你的那樣It seems that there is already a rebase-apply directory, and I wonder if you are in the middle of another rebase. If that is the case, please try git rebase (--continue | --abort | --skip) It seems that there is already a rebase-apply directory, and I wonder if you are in the middle of another rebase. If that is the case, please try git rebase (--continue | --abort | --skip)您正處於變基過程中。 您首先必須通過以下方式中止或繼續此變基

git rebase --continue

git rebase --abort

然后再次拉

git pull --rebase origin master

您必須先從遙控器獲取最新的更改,然后才能推送您的更改。 這就是您對git pull --rebase但看起來它不起作用。

你確認拉動成功了嗎?
你沒有發生任何沖突嗎?

先試試這個沒有變基的拉動,看看它是否有效

git pull origin master

比你可以用 --rebase 再次拉

git pull --rebase origin master

然后推一下

git push origin master

我認為這個問題可能有兩個重要原因,一是 fetch Repo 或者是在Vs-code 或者源碼控制之類的工具中運行一個或多個進程,最好檢查一下。

如果你看到

[拒絕] master -> master(非快進)

最好獲取所有 Repo :

首先

git fetch origin master

現在你可以看到:

分支主 -> FETCH_HEAD

下一個

git push -f origin master

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM