July 2018 | VirtualSpecies

Remove Local Git Branches

Sometimes we fall in need that we need to remove all the local git branches that are not on the remote. We create a pull request after finishing our tasks and merge that pull into the master, we have an option to delete that particular sub-branch at that time.

Git Branch
Once we delete that sub-branch from the server, we can run any of the following commands to remove that branch from the remote tracking branch list_
$ git remote prune origin
$ git fetch origin --prune
$ git fetch origin -p