After cloning a repo from the remote, I am on the master
branch. When typing git branch
to view the branch list, there's only master
in the list.
Over time, checking out existing branches as well as creating new branches, eventually merging new work into master
and pushing to origin
. Now, typing git branch
shows a long list with dozens of branches.
How can I reduce the list, removing specific branches from the list while retaining others on the list?
Update 1: To clarify, I am not interested in deleting any branch from the repo (and definitely not from the remote repo). Just making it easier to navigate between the subset of branches I regularly use at a given time.
Update 2: Consider -
$ git clone myrepo
$ git branch
* master
$ git checkout mybranch
$ git branch
master
* mybranch
$ git checkout master
$ git branch
* master
mybranch
$ git "I'll not be dealing with mybranch for 91 days, do something to clean the list"
$ git branch
* master
(playing DOOM for 91 days)
$ git checkout mybranch
$ git branch
master
* mybranch