开发者

/usr/lib/git-core/git-rebase: 590: cannot open /home/mathieu/dummy/.git/rebase-merge/rewritten: No such file

I tried a rebase of my local branch (call it 'local') into master. Here is what I did:

$ git checkout local
$ git rebase -s ours master
First, rewinding head to replay your work on top of it...
...
Already applied: 0017 smore more work
/usr/lib/git-core/git-rebase: 590: cannot open /home/mathieu/dummy/.git/rebase-merge/rewritten: No such file
All done.

I can find some references to my local branch from the comment, but I do not know how to resurect the code. Eg:

$ cd .git && grep -lr "smore more work" *
logs/refs/heads/progresscallback
logs/开发者_C百科HEAD


I'm assuming that the rebase didn't actually succeed fully?

What you probably want to do is look at git reflog show local. You should see some previous positions of the local branch, hopefully something generally like this:

d22ffd5 local@{0}: rebase finished: refs/heads/local onto fd02971501218f3817ceffa970ae9a4813139ae0
9011ecf local@{1}: commit: foo
6134eab local@{2}: commit: bar

and assuming local is still checked out (check it out if it's not) all you need do is git reset --hard 9011ecf, where that's the SHA1 of the commit the branch pointed to just before the rebase. That will, very simply, reset the local branch to point back to that commit again, and update your index and work tree along with it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜