How can I delete a remote branch in a local git repository?

前端 未结 2 2032
闹比i
闹比i 2021-02-02 06:49

All the remote branches are visible as remotes in my local git repository after a git fetch.

How to selectively remove the remote branches in my local repository (not in

2条回答
  •  情书的邮戳
    2021-02-02 07:18

    I had a slightly different but similar issue, but the solution might be useful to others who stumble on this question...

    I noticed that my local repository still had remote branches that no longer existed on the remote, so I wanted to remove them. The solution is simply to fetch with the --prune (or -p) option:

    git fetch --prune
    

提交回复
热议问题