How to Delete a Git Branch

Comentários | 0 Min de Leitura

31 Jul 2020

Delete a branch is pretty simple, but I keep forgetting, so this post will serve me as a way to remember how to do this simple task.

git branch -d <branch-name>
git branch -D <branch-name>

Ok, that’s it. But, if you’re curious the d means that you want to delete it. And D it’s a shortcurt for --delete --force. As always, I higly recommend to look up on the git documentation.

Btw, if you want to do the same on a remote repository you should use:

git push <remote> -d <branch-name> 
comments powered by Disqus