How do I delete a Git branch locally and remotely?

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

    Deleting Branches

    Let's assume our work on branch "contact-form" is done and we've already integrated it into "master". Since we don't need it anymore, we can delete it (locally):

    $ git branch -d contact-form
    

    And for deleting the remote branch:

    git push origin --delete contact-form
    

提交回复
热议问题