git branch -rd remote/branch删除的是什么?
仅有的幸福
仅有的幸福 2017-05-02 09:35:31
0
1
725

git branch -rd remote_name/branch_name
删除后提示成功,
使用
git branch -r
得到远程分支列表,没有了分支remote_name/branch_name,
再使用
git pull
发现又从远端获得了分支branch_name,

git branch -rd remote_name/branch_name
删除的是什么?

这里给出我的git版本:
git version
git version 2.7.0.windows.1

仅有的幸福
仅有的幸福

reply all (1)
给我你的怀抱

git branch -r操作的是remote-tracking branch这个branch依然是你本地的,不过它不能被编辑。
譬如当你从一个remotefetch时,如果在此之前其他人在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/somebranchThis 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 throughgit push.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!