git push -f --mirror-所有其他分支都去了哪里? [英] git push -f --mirror - Where did all the Other Branches Go?

查看:684
本文介绍了git push -f --mirror-所有其他分支都去了哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,在使用命令git push -f --mirror重命名我的本地分支之后,它也在远程仓库上成功地重命名了它,但是所有其他分支都消失了.当我在BitBucket中查看远程存储库的分支时刷新存储库时,这是一个巧合(或者它们消失了,也许有人删除了它们),或者此命令执行了一些我不知道的意外操作

I noticed that after renaming a local branch of mine using the command git push -f --mirror, it renamed it successfully on the remote repo too, however all the other branches disappeared that were up there. Either it's a coincidence when I refreshed our repo when viewing the branches for the remote repo in BitBucket,(they were gone, maybe someone deleted theirs) or this command did something unexpected that I'm not aware of yet

这个命令会做这样的事情,这意味着什么?发生什么事了?

would this command do such a thing and what would that mean? What happened?

推荐答案

这似乎是--mirror选项的已记录行为:

That seems to be the documented behavior of the --mirror option:

--mirror

不是指定每个引用要推送,而是指定以下所有引用 refs/(包括但不限于refs/heads/, refs/remotes/和refs/tags/)镜像到远程 资料库.新创建的本地裁判将被推送到远程 端,本地更新的参考将在远端强制更新, 和已删除的参考将从远程端删除.

Instead of naming each ref to push, specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end.

已删除的引用表示不在本地存储库中的引用".

A deleted ref means "one that is not in your local repository".

这篇关于git push -f --mirror-所有其他分支都去了哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆