git branch -rd remote_name/branch_name
After deletion, the prompt is successful.
Use git branch -r
to get the remote branch list. There is no branch remote_name/branch. _name,
and then use git pull
to find that branch branch_name was obtained from the remote end,
then what did git branch -rd remote_name/branch_name
delete?
My git version is given here: git version
git version 2.7.0.windows.1
git branch -r
操作的是remote-tracking branch
这个branch依然是你本地的,不过它不能被编辑。譬如当你从一个
remote
上fetch
时,如果在此之前其他人在remote
上提交了一个新的分支somebranch
, you may see the following message:At this time, you have one more local branch
origin/somebranch
This is a remote-tracking branch, and then you can checkout one from it to do your work:Remote branches can only be deleted through
git push
.