Bain Markev Bain Markev - 1 year ago 131
Git Question

Git: updating remote branch information

In a git repository, a remote branch I am not tracking was deleted. When I type

git branch -r

the deleted branch still shows up (and I can check it out)

What git command do I have to run to update this info?

Answer Source

If you perform something like

git branch -d -r remote_name/branch_name

you only remove your local checkout. This command doesn't do anything to the remote repository, which is why it still shows up.


git push origin :branch_name

will remove the the remote branch (note the ':'), and

git branch -d branch_name

will remove your local checkout.


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download