删除远程分支原点
delete remote branch origin
我删除了一个分支:
git branch -d branch_name
然后我推送了,但是当我列出分支时:
git branch -avv
我看到分支总是以名称 remotes/origin/branch_name
存在。
如何从那里删除分支?
当您使用 git branch -d branch_name
删除一个分支时,您只是删除了本地分支。 Push 不会影响遥控器的状态,所以 origin/branch_name 会保留。如果你想删除它,你应该按照 post 中的解释执行 git push <remote_name> --delete <branch_name>
作为重复建议。
当其他人删除远程(源)中的分支时,对它的引用将出现在您的本地存储库中,因此在拉取或获取后您仍然会看到 origin/branch_name
。要删除此引用,您必须使用 --prune.
获取
git fetch --prune
如果你愿意,你也可以在 pull 命令中组合它。
git pull --prune
我删除了一个分支:
git branch -d branch_name
然后我推送了,但是当我列出分支时:
git branch -avv
我看到分支总是以名称 remotes/origin/branch_name
存在。
如何从那里删除分支?
当您使用 git branch -d branch_name
删除一个分支时,您只是删除了本地分支。 Push 不会影响遥控器的状态,所以 origin/branch_name 会保留。如果你想删除它,你应该按照 post 中的解释执行 git push <remote_name> --delete <branch_name>
作为重复建议。
当其他人删除远程(源)中的分支时,对它的引用将出现在您的本地存储库中,因此在拉取或获取后您仍然会看到 origin/branch_name
。要删除此引用,您必须使用 --prune.
git fetch --prune
如果你愿意,你也可以在 pull 命令中组合它。
git pull --prune