无法在变基后删除本地分支。

huangapple go评论52阅读模式
英文:

Can not delete a local branch after rebase

问题

  1. 我创建了一个名为 "test" 的现有分支的副本。
  2. 我对其进行了一些重新排序的交互式提交重新排序操作。
  3. 只出现了一个冲突,我解决了它。
  4. 然后我完成了重新排序。
  5. 现在我想删除那个名为 "test" 的分支,但我收到以下错误消息:
    "error: 无法删除分支 'test',因为在 'C:/...文件路径...' 上检出"

我尝试了以下命令:

  1. git branch -d test
  2. git branch -D test
  3. git branch -d -f test
英文:

I have a strange case:

  1. I created a copy of an existing branch with the name "test"

  2. I did some rebasing on it (only reordered some commits in interactive mode)

  3. There was only one conflict, which I solved

  4. And I completed rebase

  5. Now I want to delete that test branch and I get the following error:
    <br/><br/>

    "error: Cannot delete branch 'test' checked out at 'C:/...FILEPATH..."
    <br/><br/>

I tried those:

  1. git branch -d test
  2. git branch -D test
  3. git branch -d -f test

答案1

得分: 1

无法删除当前使用的分支(如“无法删除已检出的分支'test'”所示)。首先检出不同的分支,然后尝试删除test

英文:

You cannot delete the branch you're currently using (as indicated by "Cannot delete branch 'test' checked out at"). Check out a different branch first, then try deleting test.

huangapple
  • 本文由 发表于 2023年4月20日 07:45:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76059559.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定