fetch from origin with deleted remote branches?

Chris Muench picture Chris Muench · Apr 22, 2011 · Viewed 125.2k times · Source

When I do git fetch origin and origin has a deleted branch, it doesn't seem to update it in my repository. When I do git branch -r it still shows origin/DELETED_BRANCH.

How can I fix this?

Answer

Pavan Yalamanchili picture Pavan Yalamanchili · Apr 22, 2011

You need to do the following

git fetch -p

This will update the local database of remote branches.