How do I delete a Git branch locally and remotely?

后端 未结 30 3668
被撕碎了的回忆
被撕碎了的回忆 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 04:46

    You can also do this using git remote prune origin

    $ git remote prune origin
    Pruning origin
    URL: git@example.com/yourrepo.git
     * [pruned] origin/some-branchs
    

    It prunes and deletes remote-tracking branches from a git branch -r listing.

提交回复
热议问题