当git rebase -quit, - continue和-abort时出错

发布于 2025-01-27 10:01:48 字数 1458 浏览 3 评论 0原文

我正试图将我的质量检查分支机构重新归还主分支,它要求我解决冲突。我需要首先解决一些问题,所以我做了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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海未深 2025-02-03 10:01:48

如果在中有注意。重新观察。

然后,您可以再次尝试重新考虑,然后再次解决冲突。

注意:.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, and reset --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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文