What does it mean to 'prune' a remote, and why might your local list of remote branches still show branches that were deleted on the server?

Last updated 6 July 2026

  • Pruning removes stale remote-tracking refs for branches deleted on the server. fetch adds new refs but does not delete removed ones by default.

  • Use git fetch --prune or git remote prune origin, or set fetch.prune true to prune automatically.

  • Pruning only affects remote-tracking refs, never your local branches.

  • https://dev.to/ruqaiya_beguwala/day-1130-git-fetch-prune-clean-up-stale-remote-tracking-branches-1o8f
  • https://git-scm.com/docs/git-remote
  • https://git-scm.com/docs/git-remote/fr
  • https://git-scm.com/docs/git-fetch/2.1.4
  • https://www.atlassian.com/git/tutorials/git-prune
  • https://medium.com/gitconnected/git-pruning-how-to-keep-your-repository-git-clean-and-efficient-d331bfb5ede6
All Git interview questions