使git分支主分支 [英] make git branch the master branch

查看:103
本文介绍了使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分支主分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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