1

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

Emil
  • 1,531
  • 3
  • 22
  • 47
  • 2
    You need to delete a **local remote-tracking branch**: `git branch -dr origin/add-importerror` – phd Jan 17 '23 at 11:29
  • this comment above is the actual answer – Dziad Borowy Apr 17 '23 at 09:50
  • I see this question as slightly different to the 'already has an answer' - I see this about the fact that despite a branch not existing on the remote it still shows as that when doing 'git -r' - what is needed is 'git fetch --prune' – Straff Jul 10 '23 at 23:44

1 Answers1

-1

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