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
给我你的怀抱2017-05-02 09:37:31
git branch -r
操作的是 remote-tracking branch
这个branch依然是你本地的,不过它不能被编辑。
譬如当你从一个remote
上fetch
时,如果在此之前其他人在remote
上提交了一个新的分支somebranch
, you may see the following message:
git fetch origin
remote: Counting objects: 1, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 1 (delta 0)
Unpacking objects: 100% (1/1), done.
[new branch] somebranch -> origin/somebranch
At this time, you have one more local branchorigin/somebranch
This is a remote-tracking branch, and then you can checkout one from it to do your work:
git checkout -b sbranch origin/somebranch
Remote branches can only be deleted through git push
.