Search code examples
gitbranchgit-bashgit-branch

Why does `git branch -r` still show the branch after deleting it locally?


I have a local branch add-importerror that I want to delete:

enter image description here

To do this, I followed the git branch -d <BRANCH-NAME>, based on this page. However, after having seemingly removed the branch, it still shows when I run git branch -r.

Why is this? And how can I remove it so that it won't show anymore?

enter image description here


Solution

  • I think the -r option refers to remote, so even though you deleted it locally, you are showing the remote branches.