简体   繁体   English

使git分支成为主分支

[英]make git branch the master branch

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. 如果您只有一个repo副本,则可以删除主分支,从dev分支创建一个名为master的新分支,但是如果有repo的其他副本,则必须通知其他人您已更改分支你无法控制。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM