Home  »  Git   »   Cleanup local Git from deleted remote branches

Cleanup local Git from deleted remote branches

By | January 20, 2018

When working with Git after some time local repository has excess branches which create a mess.

There is an easy way to remove branches from local repo that were deleted from remote.

Before Git 1.6.6

Two steps are needed: fetch and prune

git fetchgit remote prune your_remote

your_remote - for example origin

Git 1.6.6 and above

This version introduced command that combines fetching and pruning.

git fetch --prune

No votes yet.
Please wait...

Leave a Reply

Your email address will not be published.