I've deleted some remote branches (dev/featureA
and dev/featureB
) however when I run git remote show origin
I still see them being listed under the local branches section. E.g.
$ git remote show origin
Local branches configured for 'git pull':
dev/featureA merges with remote dev/featureA
dev/featureB merges with remote dev/featureB
Do I need to disable tracking or something similar?
This one worked for me
git branch -r -d dev/featureA
To remove the remote repository from being tracked all together locally, do the following:
git remote remove <remoteRepo>
To explicitly remove only the upstream tracking for a specific local branch , do the following:
git branch --unset-upstream <branch name>
git branch --unset-upstream dev/featureA
To remove all stale local branches that are not longer available at the remote, do the following:
git remote prune <remoteRepo>
I'd be careful with the last one and do a --dry-run
of the prune first...
More information is available http://git-scm.com/docs/git-branch
and
http://git-scm.com/docs/git-remote
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With