使git分支主分支

编程入门 行业动态 更新时间:2024-10-24 23:22:31
本文介绍了使git分支主分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的主分支与我的开发分支非常不同,我希望它不必进行合并即可成为我的主分支,这可能吗?看起来像我可以走进很多工作,如果我只是尝试做一个合并。

My master branch is so different than my development branch that I would like it to just become my master branch without having to do a merge, is this possible? Seems like I could walk into a lot of work if I just try and do a merge.

推荐答案

如果你只有一个副本你可以删除你的主分支,从你的开发分支创建一个叫做主分支的新分支,但是如果还有其他你不能控制的回购副本,你必须通知其他人你已经更改了分支。

If you just have one copy of the repo, you could just delete your master branch, create a new branch from your dev branch called master, but you will have to notify others that you have changed the branch if there are other copies of the repo you don't control.

git checkout -b dev git branch -D master git checkout -b master

更多推荐

使git分支主分支

本文发布于:2023-11-26 18:36:23,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分支   git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!