git · Git
報錯原文
You are currently rebasing branch 'feature' on '8a3f21c'.
這是什麼意思
一次 rebase 開始後停在了中途,HEAD 停在一個暫時狀態上,而不是你的分支上。你會在 rebase 期間發生衝突之後,或者 git rebase -i 在 edit、break 處停下之後看到這一行——你沒把它做完就去幹別的了。解決衝突後 git add,再用 git rebase --continue 繼續;如果打算丟掉那個提交就用 --skip。git rebase --abort 會精確回到 rebase 開始之前的位置,已提交的東西一點不丟,但你到目前為止手動解決的衝突會一起消失。
怎麼修
git rebase --abort- 來自
- git
- Git
- 29
git 的錯誤幾乎都是一種拒絕,意思是「在目前狀態下做那件事會丟掉東西」;fatal: 表示它什麼都沒改就停了,而真正的解決辦法往往在第一行下面的 hint: 行裡。
怎麼讀報錯
- 從第一行往下讀。越往下越是工具內部的事,起因通常寫在最上面。
- 有檔名和行號就從那裡查——不是堆疊最上面那一格,而是最上面那條提到你自己寫的檔案的行。
- 把報錯原文照樣去搜,但先去掉你自己的路徑和變數名,正是那些讓搜尋比對不上。
- 同一種情況在不同版本裡措辭不同。結果不對頭,就把版本號一起加進查詢。
- 貼上修法之前,先確認它會丟掉什麼。這裡面有些是不能收回的。
常見問題
Q. “You are currently rebasing branch 'feature' on '8a3f21c'.” 是什麼意思?
一次 rebase 開始後停在了中途,HEAD 停在一個暫時狀態上,而不是你的分支上。你會在 rebase 期間發生衝突之後,或者 git rebase -i 在 edit、break 處停下之後看到這一行——你沒把它做完就去幹別的了。解決衝突後 git add,再用 git rebase --continue 繼續;如果打算丟掉那個提交就用 --skip。git rebase --abort 會精確回到 rebase 開始之前的位置,已提交的東西一點不丟,但你到目前為止手動解決的衝突會一起消失。
Q. 怎麼修?
git rebase --abort —— 執行前先看上面的說明,確認這條命令會丟掉什麼。
Q. 這是哪個工具報的?
git。它屬於Git,報錯原文有 8 個詞。
相關報錯
CONFLICT (content): Merge conflict in src/app.tsxgitfatal: Unable to create '/repo/.git/index.lock': File exists.gitYou are in 'detached HEAD' state.gitWarning: you are leaving 1 commit behind, not connected to any of your branches:giterror: failed to push some refs to 'https://github.com/user/repo.git'git! [rejected] main -> main (fetch first)git! [rejected] main -> main (non-fast-forward)gitUpdates were rejected because the remote contains work that you do not have locally.git