git failed to delete branch
PHP中文网
PHP中文网 2017-05-02 09:34:58
0
6
727

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

PHP中文网
PHP中文网

认证0级讲师

reply all(6)
左手右手慢动作

git branch -d is to delete the branch

为情所困

The error message is obvious. There is no such directory. Are you sure this branch exists?

给我你的怀抱

Make sure you delete the corresponding branch. git branch查看分支是否存在,注意远程分支一定要有:

#删除远程分支
git push origin :dev
#删除本地分支
git branch -D dev
为情所困

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template