[英]How to make a branch the new master while keeping old master as a branch?
I have a project where I am building an ecommerce website in 2 different ways, one using react and one just vanilla js. 我有一个项目,在其中我以两种不同的方式构建电子商务网站,一种使用react,另一种仅使用vanilla js。 currently the vanilla branch is master and the react branch is called react-version.
目前,香草分支是master分支,而react分支称为react-version。 I would like to switch them and make the react-version the master and vanilla can be called vanillajs-version.
我想切换它们并使react-version为master和vanilla,可以称为vanillajs-version。
I have looked at some other answers but in those cases the old master is not needed while in my case it is. 我已经看过其他一些答案,但是在这些情况下,不需要老主人,而在我看来,则是。
Thanks! 谢谢!
update: 更新:
as suggested in this answer Switch branch names in git , I was able to switch name in the local repository however when I try to push to remote I get an error saying: 如此答案中的建议, 在git中切换分支名称 ,我能够在本地存储库中切换名称,但是当我尝试推送到远程时,我收到一条错误消息:
error: failed to push some refs to ' https://github.com/tito300/Elegant-TK-FullStack.git ' hint: Updates were rejected because the tip of your current branch is behind its remote counterpart.
错误:无法将一些引用推送到“ https://github.com/tito300/Elegant-TK-FullStack.git ”提示:由于当前分支的尖端位于其远程对应的后面,因此拒绝更新。 Integrate the remote changes (eg 'git pull ...') before pushing again.
在再次推送之前,集成远程更改(例如“ git pull ...”)。 See the 'Note about fast-forwards' in 'git push --help' for details.
有关详细信息,请参见“ git push --help”中的“关于快进的注意事项”。
I do not want to integrate them because they are basically different implementation. 我不想集成它们,因为它们基本上是不同的实现。 I branched out very early in the project.
我在该项目的早期就进行了分支。 any work around?
有没有解决的办法?
You can do the following steps: 您可以执行以下步骤:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.