When I type 'git branch -a', it shows red previously deleted branches. Is this normal?
I have cloned a remote GitHub repository to my computer, and it all went well. I worked on some branches, and wanted to see all of them, so I typed:
git branch -a
And it showed this:
* master remotes/origin/cleanup remotes/origin/master remotes/origin/test
I have previously created the ‘cleanup’ and ‘test’ branches, merged them, deleted them on the local side, and the remote side, and yet they are showing in this weird ‘file-directory like’ fashion. Is this normal?
Sorry if this is a bad question. I am new to Git and Github.
You need to fetch with
--prune so that deleted remote branches disappear on the local repo (no messing with local branches, even if one local branch was created from one of those deleted remote branches).
git fetch --prune -a
Answered By – eftshift0