How do I delete a Git branch locally and remotely?

后端 未结 30 3609
被撕碎了的回忆
被撕碎了的回忆 2020-11-21 04:11

I want to delete a branch both locally and remotely.

Failed Attempts to Delete a Remote Branch

$ git branch -d         


        
30条回答
  •  长情又很酷
    2020-11-21 05:01

    Another approach is:

    git push --prune origin
    

    WARNING: This will delete all remote branches that do not exist locally. Or more comprehensively,

    git push --mirror
    

    will effectively make the remote repository look like the local copy of the repository (local heads, remotes and tags are mirrored on remote).

提交回复
热议问题