Force-delete a branch in Git? [duplicate]

断了今生、忘了曾经 提交于 2020-02-21 10:19:25

问题


I have created a branch test in my Git repository. Now I have no use for it. How can I force-delete this branch?

I tried the following command:

git branch -d test

But it returns an error.


回答1:


You can force-delete a branch with the following command:

git branch -D test

By replacing -d with -D, you are telling git to delete the branch and that you don't care to merge changes from that branch.

Be careful, you can lose data.



来源:https://stackoverflow.com/questions/41379997/force-delete-a-branch-in-git

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!