我设法在本地git存储库中创建了一个小混乱。我试图通过使用以下说明修复损坏的提交。在运行“ git commit --amend”之前(以及在git rebase --interactive之后),我认为更改不正确,因此我执行了“ git reset HEAD --hard”。我告诉你,这不是一个好主意。
现在,交互式资源库似乎“卡住了”。Git将当前分支显示为(| REBASE-m)。我的存储库中的每个命令(cd ..,ls,git rebase ...)都给出以下错误:
cat:.git / rebase-merge / head-name:没有这样的文件或目录
这是git rebase --abort的样子:
$ 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的结果:
$ 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
有任何想法吗?我想将情况重设为开始进行深思熟虑的基准操作之前的状态。
这是git log --oneline显示情况的方式:
4c737fb Revert "Modified file names"
247ac02 Modified file names
33141e6 Message modifications
10a4a04 Modified db script
这很好。
我正在使用msysgit v1.7.0.2。
git rebase --quit
为我工作