Deleting remote branches?
When I run git branch -a, it prints out like this, f开发者_Go百科or ex:
branch_a
remotes/origin/branch_a
Few questions:
- What does branch_a indicate?
- What does remotes/origin/branch_a indicate?
- How do I delete remotes/origin/branch_a?
branch_a
indicates that you have a local branch calledbranch_a
.remotes/origin/branch_a
indicates that you have a remote calledorigin
, and you are tracking thebranch_a
within theorigin
remote. This isn't necessarily associated with your ownbranch_a
, but it probably is (git branch -a
doesn't say).- Since the
remotes/origin/branch_a
is a remote tracking branch, it's required if your ownbranch_a
is set up to track the remote. If not, then deleting theorigin
remote should remove it, or you might be able to simplygit branch -d remotes/origin/branch_a
.
- branch_a is the local 'tracking branch' for the remote branch_a.
- remotes/origin/branch_a is a remote branch, living on the origin repository.
git push origin :branch_a
removes the remote branch from the origin repository, despite looking a bit hackish. If you want to remove branch_a, rungit branch -d branch_a
.
精彩评论