当git rebase -quit, - continue和-abort时出错
我正试图将我的质量检查分支机构重新归还主分支,它要求我解决冲突。我需要首先解决一些问题,所以我做了git rebase -abort。然后,我试图继续进行git rebase -continue,但由于错误而失败。然后,我还尝试了git rebase -quit和git rebase -abort,但也有错误。有人知道这怎么了吗?先感谢您!
PS C:\Users\Desktop\SDP-React> git rebase --abort
warning: could not read '.git/rebase-merge/head-name': No such file or directory
PS C:\Users\Desktop\SDP-React> git rebase --quit
Deletion of directory '.git/rebase-merge' failed. Should I try again? (y/n) n
error: could not remove '.git/rebase-merge'
PS C:\Users\Desktop\SDP-React> git rebase main
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase. If that is the
case, please try
git rebase (--continue | --abort | --skip)
If that is not the case, please
rm -fr ".git/rebase-merge"
and run me again. I am stopping in case you still have something
valuable there.
PS C:\Users\Desktop\SDP-React> git rebase --continue
warning: could not read '.git/rebase-merge/head-name': No such file or directory
PS C:\Users\Desktop\SDP-React> git rebase main
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase. If that is the
case, please try
git rebase (--continue | --abort | --skip)
If that is not the case, please
rm -fr ".git/rebase-merge"
and run me again. I am stopping in case you still have something
valuable there.
I'm trying to rebase my QA branch to main branch, and it was asking me to resolve the conflicts. There were some issues that I needed to solve first so I did git rebase --abort. then I tried to continue with git rebase --continue but failed with errors. Then I also try git rebase --quit and git rebase --abort but also had errors. Anyone knows what was wrong with it? Thank you in advance!
PS C:\Users\Desktop\SDP-React> git rebase --abort
warning: could not read '.git/rebase-merge/head-name': No such file or directory
PS C:\Users\Desktop\SDP-React> git rebase --quit
Deletion of directory '.git/rebase-merge' failed. Should I try again? (y/n) n
error: could not remove '.git/rebase-merge'
PS C:\Users\Desktop\SDP-React> git rebase main
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase. If that is the
case, please try
git rebase (--continue | --abort | --skip)
If that is not the case, please
rm -fr ".git/rebase-merge"
and run me again. I am stopping in case you still have something
valuable there.
PS C:\Users\Desktop\SDP-React> git rebase --continue
warning: could not read '.git/rebase-merge/head-name': No such file or directory
PS C:\Users\Desktop\SDP-React> git rebase main
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase. If that is the
case, please try
git rebase (--continue | --abort | --skip)
If that is not the case, please
rm -fr ".git/rebase-merge"
and run me again. I am stopping in case you still have something
valuable there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果在
中有注意。重新观察。
然后,您可以再次尝试重新考虑,然后再次解决冲突。
注意:
.git
文件夹本身是隐藏的,因此您需要配置Windows File Explorer to 显示“隐藏的项目” 。删除文件夹后,确实可以进行新的重态,因为 op thi nguyen =“ https://stackoverflow.com/questions/72181902/Error-when-git-rebase-rebase-quit-continue-and-abort#comment127574387_72182616”>评论。
If there is noting in
.git/rebase-merge
, your safe bet is to delete that folder, andreset --hard
your repository, to go back to a state before the rebase.Then you can try the rebase again, and resolve conflicts again.
Note: the
.git
folder itself is hidden, so you need to configure your Windows File Explorer to display "Hidden items".Once the folder is deleted, a new rebase can indeed take place, as the OP Thi Nguyen confirms in the comments.