fatal: Could not open file .git/rebase-merge/done for reading: No such file or directory

后端 未结 4 744
走了就别回头了
走了就别回头了 2021-02-03 17:21

I was going to do a rebase to delete my last commit but I didn\'t want to finish so I exited. (I realize this probably was not the best way to go about it, but it\'s done) I gue

4条回答
  •  囚心锁ツ
    2021-02-03 17:58

    Stash or commit didn't work for me, I just created the files that git was complaining about until it worked!

    $ git rebase --abort
    error: could not read '.git/rebase-apply/head-name': No such file or directory
    
    echo "master" > .git/rebase-apply/head-name
    
    $ git rebase --abort
    error: could not read '.git/rebase-apply/onto': No such file or directory
    
    $ echo "develop" > .git/rebase-apply/onto
    
    $ git rebase --abort
    error: could not read '.git/rebase-apply/head': No such file or directory
    
    $ echo "develop" > .git/rebase-apply/head
    

    After which git rebase --abort worked. The branch names you are putting in those files needs to exists, and in my case I didn't care about my local changes, but obviously be careful with this if you do.

提交回复
热议问题