问题
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