git branch -dr origin/feature-x

Category: Git - Core

git branch -dr origin/feature-x

Delete a remote-tracking branch locally

Removes the local copy of a remote branch, origin/feature-x, without touching the remote itself. It cleans up stale tracking refs, which git fetch --prune also does automatically. The -r flag targets remote-tracking branches only.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.