How do you remove an invalid remote branch reference from Git?

前端 未结 11 2245
攒了一身酷
攒了一身酷 2020-11-28 16:43

In my current repo I have the following output:

$ git branch -a
* master
  remotes/origin/master
  remotes/public/master

I want to delete <

11条回答
  •  执念已碎
    2020-11-28 17:31

    All you need to do is

    git fetch -p
    

    It'll remove all your local branches which are remotely deleted.

    If you are on git 1.8.5+ you can set this automatically

    git config fetch.prune true
    

    or

    git config --global fetch.prune true
    

提交回复
热议问题