在git中替换master分支并防止快进 [英] Replacing the master branch in git and preventing fast forward

查看:166
本文介绍了在git中替换master分支并防止快进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在github上有一个库,大约一年前,我完成了一个不向后兼容的应用程序的重写。它在一个叫结构化的分支上。
现在大多数安装该库的人都在使用该分支,我想让它成为主人,并将当前主人移动到传统。

I have a library on github and about a year ago I did a complete rewrite of the app that is not backwards compatible. It is on a branch called 'structured'. Now most people who are installing the library are using that branch and I would like to make it the master and move the current master to 'legacy'.

我不希望那些在老主人身上的人能够快速前进到新主人,因为他肯定会破坏他们的应用程序。是否有可能将它们转移到遗留分支,或者至少抛出一个异常并显示一条消息,告诉他们检出遗留分支?

I don't want people who were on the old master to be able to fast forward to the new master because it would break their apps for sure. Is it possible to divert them to the legacy branch, or at least throw an exception and display a message telling them to checkout the legacy branch?

推荐答案

我不认为这是可能的,除非你实现一个钩子,但它可能不值得。

I don't think it's possible unless you implement a hook, but it may not be worth it.

我想我只是克隆回购我的服务器,将旧的回购保持原样,如果需要的话修正错误,并为新的结构化库创建另一个回购。

I think i'd simply clone the repo on my server, leave the old repo as it is, pulling bugfixes if needed and create another repo for the new "structured" library.

这篇关于在git中替换master分支并防止快进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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