Delete branches listed by git branch -a

前端 未结 4 737
Happy的楠姐
Happy的楠姐 2021-02-12 11:44

The command git branch -a lists a bunch of branches that are NOT on the repository, and NOT local branches. How can these be deleted?

* develop
  m         


        
4条回答
  •  执念已碎
    2021-02-12 12:04

    It may also happen that the remote repository reference has been deleted from the local clone, but still appears in the output of the 'git branch -a' command. In any case, you can always suppress any reference simply by deleting the corresponding files:

    $ rm -f .git/refs/remotes/cloner
    $ rm -rf .git/refs/remotes/deprecated_remote
    

提交回复
热议问题