Problem description:
git branch shows that the local branch has the branch I want to delete
git checkout -b [filename] shows that the branch does not exist (not found)
git checkout [filename] shows failed to lock ref for update: no such file or directory
Please tell me how to solve this problem
git branch -d
is to delete the branchThe error message is obvious. There is no such directory. Are you sure this branch exists?
Make sure you delete the corresponding branch.
git branch
查看分支是否存在,注意远程分支一定要有:
Not particularly understandable. . . Why do I need git checkout -b to delete a branch? If you want to delete a branch, shouldn't you first switch to another branch and then git branch -d?
-b means build, which means new.
-d means delete. This is the deletion you want.
Direct
git branch -D branch-name (branch name)
Force deletion