Search code examples
gitgithubterminaliterm2

How do we remove branches that no longer exist from the auto complete in Git?


enter image description here

^ For example, you can see that after I run git br (alias for git branch)

I no longer have the fix/add-themed-validation branch, I deleted it.

However when I try to check out a different branch with a similar name, the fix branch is in my auto complete.


Solution

  • That probably the one from a remote (e.g. origin). You need to remove that one from the remote and "prune"

    git fetch --prune