Git - 如何修复“损坏的”互动式底座? [英] Git - How to fix "corrupted" interactive rebase?
问题描述
我在本地git存储库中创建了一些混乱。我试图通过使用下面的说明修复损坏的提交。在运行git commit --amend(以及git rebase --interactive之前)之前,我确定我的更改不正确,因此我执行了git reset HEAD --hard。不是一个好主意,我告诉你。
现在交互式底图似乎卡住了。 Git将当前分支显示为(| REBASE-m)。每个命令(cd ..,ls,git rebase ...)在我的仓库中都会给出以下错误:
$ b
cat:.git / rebase-merge / head-name:没有这样的文件或目录
以下是git rebase --abort的样子:
$ git rebase --abort
cat:c:/ _ work / project / src / git / .git / rebase-merge / quiet:没有这样的文件或目录
cat:c:/ _ work / project / src / git / .git / rebase-merge / head-name:没有这样的文件或目录$ b $ cat:c:/ _ work /project/src/git/.git/rebase-merge/orig-head:没有这样的文件或目录
HEAD现在在4c737fb恢复修改文件名
rm:无法删除`c:/ _work / project / src / git / .git / rebase-merge / done':Permission denied
rm:无法移除目录`c:/ _ work / project / src / git / .git / rebase-merge':目录
不为空
cat:.git / rebase-merge / head-name:没有这样的文件或目录
这是git rebase的结果 - continueue:
$ git rebase --continue
cat:c:/ _ work / project / src / git / .git / rebase-merge / prev_head:没有这样的文件或目录
cat:c:/ _ work / project / src / git / .git / rebase-merge / end:没有这样的文件或目录
cat:c:/ _ work / project / src / git / .git / rebase -merge / msgnum:没有这样的文件或目录
cat:c:/ _ work / project / src / git / .git / rebase-merge /到:没有这样的文件或目录
cat:c:/ _work / project / src / git / .git / rebase-merge / quiet:没有这样的文件或目录
prev_head必须定义
cat:.git / rebase-merge / head-name:没有这样的文件或目录
任何想法?我希望将情况重新调整到开始我的精心设计的rebase操作之前的状态。
以下是git log --oneline显示情况的方式:
4c737fb恢复修改的文件名
247ac02修改的文件名
33141e6修改信息
10a4a04修改后的数据库脚本
这很好。
我使用msysgit v1.7.0.2。
它看起来像Git试图删除 .git / rebase-merge
目录,但无法完全删除它。你有没有尝试复制该文件夹?如果存在,也拷贝 .git / rebase-apply
文件夹。
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.
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: No such file or directory
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
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.
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
And this is fine.
I'm using msysgit v1.7.0.2.
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.
这篇关于Git - 如何修复“损坏的”互动式底座?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!