Read more

Git: Remove information on branches that were deleted on origin

Arne Hartherz
March 01, 2012Software engineer at makandra GmbH

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

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

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.

Posted by Arne Hartherz to makandra dev (2012-03-01 14:57)