Git: Remove information on branches that were deleted on origin

Posted About 12 years ago. Visible to the public.

When branches get deleted on origin, your local repository won't take notice of that.

You'll still have your locally cached versions of those branches (which is actually good) but git branch -a will still list them as remote branches.

You can clean up that information locally like this:

git remote prune origin

Your local copies of deleted branches are not removed by this.

The same effect is achieved by using (kudos to Julien Show archive.org snapshot ):

git fetch --prune

You could also set that as a default.

Arne Hartherz
Last edit
Almost 12 years ago
Keywords
clear, clean
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2012-03-01 13:57)