Visual Studio Code - remove branches deleted on GitHub that still show in VS Code?
Apparently, this feature is intentional. I found out that a correct way to remove all remote branches that have been deleted from Github is to run the following command.
git fetch --prune
Then restart visual studio to remove the branches from the command palette
Local branches can be removed from Visual Studio Code by opening the Command Pallete (Ctrl-Shift-P) then Selecting Git: Delete Branch..., you can then delete the local branch by selecting the appropriate one from the list.
Branches removed from GitHub are well... just removed from GitHub. You still have local copy of branch on your machine. To delete local branch run git branch -d the_local_branch
. There is no command in VS Code to do so, but you can start terminal in VSCode using View: Toggle Integrated Terminal
command and run command from it.
For more information about branch management please visit git documentation - https://git-scm.com/book/be/v2/Git-Branching-Branch-Management