4

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?

Snowcrash
  • 80,579
  • 89
  • 266
  • 376

3 Answers3

4

This one worked for me

 git branch -r -d dev/featureA
Developer
  • 25,073
  • 20
  • 81
  • 128
3

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

g19fanatic
  • 10,567
  • 6
  • 33
  • 63
2

Snow try with the next command:

git fetch origin --prune

This command is to remove deleted branches. If not, please visit this link and see if some of those command could help you. Regards!

Community
  • 1
  • 1
Moises Gonzaga
  • 151
  • 1
  • 17