執(zhí)行g(shù)it rebase過程中斷后報(bào)No such file or directory錯(cuò)誤的解決方法

執(zhí)行g(shù)it rebase過程中斷后報(bào)No such file or directory錯(cuò)誤的問題解決方法.PNG

問題描述

在執(zhí)行g(shù)it rebase命令的時(shí)候通過Ctrl+C組合鍵中斷rebase操作后震嫉,再次執(zhí)行--contunue或--skip選項(xiàng)會(huì)出現(xiàn)如下提示:

error: could not read '.git/rebase-apply/head-name': No such file or directory

操作過程

  • 第一步:git rebase origin/master
  • 第二步:快速按Ctrl+C組合鍵中斷
  • 第三步:執(zhí)行git rebase --contunuegit rebase --skip等出現(xiàn)錯(cuò)誤提示。

以下是參考操作路徑:

Klavor@DESKTOP-I8SM701 MINGW64 ~/Workspace/blog-image-provider (master)
$ git rebase origin/master
First, rewinding head to replay your work on top of it...

Klavor@DESKTOP-I8SM701 MINGW64 ~/Workspace/blog-image-provider ((aa1bd07...)|AM/REBASE)
$ git status
rebase in progress; onto (NULL)
You are currently rebasing.
  (all conflicts fixed: run "git rebase --continue")

nothing to commit, working tree clean

Klavor@DESKTOP-I8SM701 MINGW64 ~/Workspace/blog-image-provider ((aa1bd07...)|AM/REBASE)
$ git checkout master
Previous HEAD position was aa1bd07 「黑暗料理」假蒟煎蛋 https://www.klavor.com/cooking/20200508-795.html Author : Klavor Lee Date : 2020-05-08 Category : cooking
Switched to branch 'master'
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

Klavor@DESKTOP-I8SM701 MINGW64 ~/Workspace/blog-image-provider (master|AM/REBASE)
$ git log
commit ce6bf1b71cb731d08ef66432edbe58bd62d85512 (HEAD -> master)
Author: Klavor Lee <lee@klavor.com>
Date:   Fri Jun 12 01:35:47 2020 +0800

    dsfasdf

commit 13ef1b0206d0b1859574c01270c4dcba78dfe14d
Author: Klavor Lee <lee@klavor.com>
Date:   Wed Nov 6 18:07:42 2019 +0800

    「科學(xué)上網(wǎng)」Shadowsocks服務(wù)端快速搭建腳本使用教程
    Url : https://www.klavor.com/dev/20191106-700.html
    Author : Klavor Lee
    Date : 2019-10-31
    Category : dev

commit 17cc23aca3b8242eaf73444ff8f525f04d776b80
Author: Klavor Lee <lee@klavor.com>
Date:   Fri Nov 1 12:27:22 2019 +0800

    找工作
    Url : https://www.klavor.com/essay/20191031-695.html
    Author : Klavor Lee

Klavor@DESKTOP-I8SM701 MINGW64 ~/Workspace/blog-image-provider (master|AM/REBASE)
$ git rebase origin/master
fatal: 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)
If that is not the case, please
        rm -fr ".git/rebase-apply"
and run me again.  I am stopping in case you still have something
valuable there.


Klavor@DESKTOP-I8SM701 MINGW64 ~/Workspace/blog-image-provider (master|AM/REBASE)
$ git rebase --continue
error: could not read '.git/rebase-apply/head-name': No such file or directory

Klavor@DESKTOP-I8SM701 MINGW64 ~/Workspace/blog-image-provider (master|AM/REBASE)
$ git rebase --skip
error: could not read '.git/rebase-apply/head-name': No such file or directory

Klavor@DESKTOP-I8SM701 MINGW64 ~/Workspace/blog-image-provider (master|AM/REBASE)
$ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

You are currently rebasing.
  (all conflicts fixed: run "git rebase --continue")

nothing to commit, working tree clean

解決辦法

根據(jù)再次輸入命令git rebase origin/master后的提示重归,可知推薦的兩種操作。

git rebase (--continue | --abort | --skip)

rm -fr ".git/rebase-apply"

但是瞻想,git rebase (--continue | --abort | --skip)前面已經(jīng)說過了蜕窿,會(huì)出現(xiàn)error: could not read '.git/rebase-apply/head-name': No such file or directory的異常提示寂玲。因此通過rm -fr ".git/rebase-apply"將git rebase產(chǎn)生的中間文件刪除即可。

刪除后冠摄,重新再執(zhí)行git rebase origin/master即可正常完成rebase糯崎。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市河泳,隨后出現(xiàn)的幾起案子沃呢,更是在濱河造成了極大的恐慌,老刑警劉巖拆挥,帶你破解...
    沈念sama閱讀 222,252評(píng)論 6 516
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件薄霜,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡纸兔,警方通過查閱死者的電腦和手機(jī)惰瓜,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,886評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來汉矿,“玉大人崎坊,你說我怎么就攤上這事「旱椋” “怎么了流强?”我有些...
    開封第一講書人閱讀 168,814評(píng)論 0 361
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)呻待。 經(jīng)常有香客問我打月,道長(zhǎng),這世上最難降的妖魔是什么蚕捉? 我笑而不...
    開封第一講書人閱讀 59,869評(píng)論 1 299
  • 正文 為了忘掉前任奏篙,我火速辦了婚禮,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘秘通。我一直安慰自己为严,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,888評(píng)論 6 398
  • 文/花漫 我一把揭開白布肺稀。 她就那樣靜靜地躺著第股,像睡著了一般。 火紅的嫁衣襯著肌膚如雪话原。 梳的紋絲不亂的頭發(fā)上夕吻,一...
    開封第一講書人閱讀 52,475評(píng)論 1 312
  • 那天,我揣著相機(jī)與錄音繁仁,去河邊找鬼涉馅。 笑死,一個(gè)胖子當(dāng)著我的面吹牛黄虱,可吹牛的內(nèi)容都是我干的稚矿。 我是一名探鬼主播,決...
    沈念sama閱讀 41,010評(píng)論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼捻浦,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼晤揣!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起朱灿,我...
    開封第一講書人閱讀 39,924評(píng)論 0 277
  • 序言:老撾萬榮一對(duì)情侶失蹤碉渡,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后母剥,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體滞诺,經(jīng)...
    沈念sama閱讀 46,469評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,552評(píng)論 3 342
  • 正文 我和宋清朗相戀三年环疼,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了习霹。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,680評(píng)論 1 353
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡炫隶,死狀恐怖淋叶,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情伪阶,我是刑警寧澤煞檩,帶...
    沈念sama閱讀 36,362評(píng)論 5 351
  • 正文 年R本政府宣布,位于F島的核電站栅贴,受9級(jí)特大地震影響斟湃,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜檐薯,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,037評(píng)論 3 335
  • 文/蒙蒙 一凝赛、第九天 我趴在偏房一處隱蔽的房頂上張望注暗。 院中可真熱鬧,春花似錦墓猎、人聲如沸捆昏。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,519評(píng)論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽骗卜。三九已至,卻和暖如春左胞,著一層夾襖步出監(jiān)牢的瞬間膨俐,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,621評(píng)論 1 274
  • 我被黑心中介騙來泰國(guó)打工罩句, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人敛摘。 一個(gè)月前我還...
    沈念sama閱讀 49,099評(píng)論 3 378
  • 正文 我出身青樓门烂,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親兄淫。 傳聞我的和親對(duì)象是個(gè)殘疾皇子屯远,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,691評(píng)論 2 361