Delete Git branch locally and remotely

I stumble across this one every so often. And since I have to look it up every time, I may as well document it. Today's post is small and easy.

To delete a Git branch after the completion of a feature or bug fix, you can use the following commands. Cause the CLI rules, right, RIGHT?

Anyway, back to the task at hand.

As you realize, there are 3 different branches that need to be deleted in Git:

  1. The local <branch>
  2. The remote origin/<branch>.
  3. The local remote-tracking branch origin/<branch> that tracks the remote <branch>

No more googlebinging for this. Now you know where to get the answer :)

RELATED POSTS


  • Share this post on