Git 本地分支删除 分支明明存在,删除却提示错误。

clipboard.png

Git 分支明明存在,删除时却提示错误,如何解决?

阅读 4.8k
2 个回答

两种可能。

  1. 打开 .git/packed-refs 文件,搜索一下 feature-upcategory,如果有就把那一行删除。
  2. 打开 .git/refs/HEADS 文件夹,找一下有没有这个 feature-upcategory,如果有就把这个文件删除。

stackoverflow看来的

Branches are stored as files containing the SHA they point to. Try deleting the file for this branch, named localbranch, from the .git/refs/head/ directory within your project:

rm .git/refs/heads/localbranch

Note that if this branch exists on the remote server as well (though the branch name doesn't suggest so), you could use git push origin :branchname to do that

stackoverflow 原链接

应该不用翻译了吧?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进