How do I delete a Git branch locally and remotely?

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

    This is simple: Just run the following command:

    To delete a Git branch both locally and remotely, first delete the local branch using this command:

    git branch -d example
    

    (Here example is the branch name.)

    And after that, delete the remote branch using this command:

    git push origin :example
    

提交回复
热议问题