I have uploaded (pushed the entire local branch) to the remote repo. I have merged it with master and deleted it in the remote repo (on github.com)
Running git branch -a
still shows it in the console:
$ git branch -a
* master
remotes/hivauz/master
remotes/hivauz/new_local_branch
What's the reason, does github need time to update it?
Steps to delete remote Git branchesIssue the git push origin –delete branch-name command, or use the vendor's online UI to perform a branch deletion. After the remote branch is deleted, then delete the remote tracking branch with the git fetch origin –prune command.
Deleting both a local and a remote branchThey are completely separate objects in Git. Even if you've established a tracking connection (which you should for most scenarios), this still does not mean that deleting one would delete the other, too!
git fetch --prune is the best utility for cleaning outdated branches. It will connect to a shared remote repository remote and fetch all remote branch refs. It will then delete remote refs that are no longer in use on the remote repository.
In order to clean up remote-tracking branches while fetching, use the “git fetch” command with the “–prune” option. Alternatively, you can simply use the “-p” shortcut instead of typing “prune” every time.
You have to run git fetch --all --prune
in order to remove the remote branch reference in your local environment.
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