I want to delete a remote branch. How can I do git push origin --delete my-branch in magit, to delete a remote branch?

1 Answer 1


In Magit the command for deleting a remote branch is the same as for deleting a local branch, and its key binding is b k.

So to delete my-branch on origin you would type b k origin/my-branch RET.

  • b k only removes the local one. The pushed remote branch still exists on Github
    – Student
    Nov 29, 2020 at 12:39
  • b k first tries to delete the remote branch using git push origin --delete my-branch and if and only if that fails (e.g. because you don't have write permissions), then it deletes the respective local ref only.
    – tarsius
    Nov 29, 2020 at 17:05
  • 1
    @Student Errr... Just so you know, tarsius is the chief maintainer of magit. :-)
    – TerryTsao
    Nov 30, 2020 at 3:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.