如果我删除其他人正在处理的远程分支会发生什么?
我已经创建了一个远程分支,现在我想删除它,因为它已合并回我们的集成分支中。我执行了
git push origin :name_of_branch
删除远程分支的操作。
然而,不幸的是我错了,其他开发人员之一实际上有源自该分支的本地提交。我如何打扰他的工作,当他拉动时,他的变化现在是否处于危险之中?
谢谢
I have created a remote branch, that I now want to delete because it is merged back into our integration branch. I do a
git push origin :name_of_branch
to delete the remote branch.
However, unfortunately I was mistaken and one of the other developers actually has local commits originating on that branch. How do I disturb his work, is his changes now in danger when he pulls?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
拉取永远不会删除您的本地分支。如果您的其他开发人员使用
git fetch --prune
,他的本地远程跟踪分支(例如remote/origin/name_of_branch
)将被删除,但他正在处理的本地版本应该保持不变,当他再次推动它们时,分支将被重新创建。(尽管根据上下文将新提交推送到新分支名称下可能更有用。)
Pulling never deletes your local branch. If your other developer uses
git fetch --prune
, his local remote tracking branches (e.g.remote/origin/name_of_branch
) would be deleted, but the local version he is working on should stay untouched, and when he pushes them again, the branch would be recreated.(Though it might be more useful to push the new commits under a new branch name, depending on context.)