1

This is not a duplicate of How do I delete a Git branch both locally and remotely?, and I've read Delete local “remote branch” without deleting remote branch? but get little help.

There was a branch called stats_dev before. After merging it to master and deleting it on GitHub, I did git branch -d stats_dev so stats_dev branch is gone remotely and locally.

However, now I do git branch -a and I find the list pasted below:

* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/stats_dev

It seems that remotes/origin/stats_dev still somehow exists. I try git branch -d remotes/origin/stats_dev and git branch -d origin/stats_dev, but error messages like error: branch 'origin/stats_dev' not found. are returned. How can I get rid of remotes/origin/stats_dev?

ytu
  • 1,822
  • 3
  • 19
  • 42

1 Answers1

2

A git fetch --all --prune should get rid of what is effectively a pointer (a remote tracking branch tracking what the remote branch was referring to)

See git fetch: PRUNING.

smarber mentions the alternative git remote command:

git remote update -p
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250