如何解决“腐败"的问题互动变基? [英] How to fix "corrupted" interactive rebase?
问题描述
我设法在本地git存储库中创建了一个小混乱.我试图通过使用遵循说明来修复损坏的提交.在运行"git commit --amend"之前(以及在git rebase --interactive之后),我认为更改不正确,因此我执行了"git reset HEAD --hard".我告诉你,这不是一个好主意.
I managed to create a little mess in my local git repository. I was trying to fix a broken commit by using the following instructions. Before running the "git commit --amend" (and after the git rebase --interactive) I decided that my changes were incorrect and so I executed "git reset HEAD --hard". Not a good idea, I tell you.
现在,交互式资源库似乎卡住了".Git将当前分支显示为(| REBASE-m).我的存储库中的每个命令(cd ..,ls,git rebase ...)都给出以下错误:
Now the interactive rebase seems to be "stuck". Git shows the current branch as (|REBASE-m). Every command (cd .., ls, git rebase...) inside my repository gives the following error:
cat:.git/rebase-merge/head-name:没有这样的文件或目录
cat: .git/rebase-merge/head-name: No such file or directory
这是git rebase --abort的样子:
Here's how git rebase --abort looks like:
$ git rebase --abort
cat: c:/_work/project/src/git/.git/rebase-merge/quiet: No such file or directory
cat: c:/_work/project/src/git/.git/rebase-merge/head-name: No such file or directory
cat: c:/_work/project/src/git/.git/rebase-merge/orig-head: No such file or directory
HEAD is now at 4c737fb Revert "Modified file names"
rm: cannot remove `c:/_work/project/src/git/.git/rebase-merge/done': Permission denied
rm: cannot remove directory `c:/_work/project/src/git/.git/rebase-merge': Directory
not empty
cat: .git/rebase-merge/head-name: No such file or directory
这是git rebase的结果--continue:
Here's the result of git rebase --continue:
$ git rebase --continue
cat: c:/_work/project/src/git/.git/rebase-merge/prev_head: No such file or directory
cat: c:/_work/project/src/git/.git/rebase-merge/end: No such file or directory
cat: c:/_work/project/src/git/.git/rebase-merge/msgnum: No such file or directory
cat: c:/_work/project/src/git/.git/rebase-merge/onto: No such file or directory
cat: c:/_work/project/src/git/.git/rebase-merge/quiet: No such file or directory
prev_head must be defined
cat: .git/rebase-merge/head-name: No such file or directory
有什么想法吗?我想将情况重设为开始进行深思熟虑的基准操作之前的状态.
Any ideas? I would like to reset the situation back to the state it was before I started my well-thought rebase operation.
这是git log --oneline显示情况的方式:
Here's how git log --oneline shows the situation:
4c737fb Revert "Modified file names"
247ac02 Modified file names
33141e6 Message modifications
10a4a04 Modified db script
这很好.
我正在使用msysgit v1.7.0.2.
I'm using msysgit v1.7.0.2.
推荐答案
Git似乎试图删除 .git/rebase-merge
目录,但无法将其完全删除.您是否尝试过复制该文件夹?如果存在,也请复制 .git/rebase-apply
文件夹.
It looks like Git tried to remove the .git/rebase-merge
directory but wasn't able to remove it completely. Have you tried copying that folder away? Also copy away the .git/rebase-apply
folder if that is present.
这篇关于如何解决“腐败"的问题互动变基?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!