英文:
Can not delete a local branch after rebase
问题
- 我创建了一个名为 "test" 的现有分支的副本。
- 我对其进行了一些重新排序的交互式提交重新排序操作。
- 只出现了一个冲突,我解决了它。
- 然后我完成了重新排序。
- 现在我想删除那个名为 "test" 的分支,但我收到以下错误消息:
"error: 无法删除分支 'test',因为在 'C:/...文件路径...' 上检出"
我尝试了以下命令:
- git branch -d test
- git branch -D test
- git branch -d -f test
英文:
I have a strange case:
-
I created a copy of an existing branch with the name "test"
-
I did some rebasing on it (only reordered some commits in interactive mode)
-
There was only one conflict, which I solved
-
And I completed rebase
-
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:
- git branch -d test
- git branch -D test
- 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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论