简体   繁体   English

git:我将master合并为development,现在呢?

[英]git: I merged master into develop, now what?

I'm a one man shop and I've been working on a development branch for quite a while. 我是一个单人商店,并且我已经在开发部门工作了一段时间。 I wanted to merge the branches and get back to one branch...master. 我想合并分支,然后回到一个分支...大师。 Somehow, and I'm not sure how, I merged the branches and now I'm on develop. 不知如何,我不确定如何合并分支,而现在正在开发中。

Should I somehow delete one of the branches? 我应该以某种方式删除其中一个分支吗?

How do I fix this to have one branch and it be master? 如何解决这个问题,使其拥有一个分支并且成为主分支?

git checkout master

The above command will put you in the master branch 上面的命令将使您进入master分支

git merge develop

Above will bring whatever is in the develop branch into your master branch 以上将把开发分支中的内容带入您的主分支

git branch -d develop

Above will delete the develop branch 上面将删除开发分支

However, i suggest keeping the develop branch. 但是,我建议保留开发分支。

Commit and push your changes on your current branch then do: 在当前分支上提交并推送您的更改,然后执行:

git merge development
git checkout development
git merge master
git branch -D development

I would like to add these for your convenience. 为了方便起见,我想添加这些内容。 When you are going with continuous development, it's better you follow a particular branching model. 在进行持续开发时,最好遵循特定的分支模型。 I think git-flow will be one model suits for you. 我认为git-flow将是适合您的一种模型。 Or you can follow your own convenient one. 或者,您也可以按照自己方便的方式操作。

The key points you want to know are 您想知道的关键点是

  • Keep develop branch for continuous integration of development. 保留开发分支以持续集成开发。
  • Start implementing a particular feature form a feature branch derived from develop branch. develop分支派生的feature分支开始实施特定功能。
  • After you are ready to put a stable release, merge all the changes from develop branch to master , and put the release. 准备好发布稳定版本之后,请合并所有从develop分支到master的更改,然后发布发布。 Make sure mater always has a stable version. 确保母校一直有着稳定的版本。

For your particular question, I would answer this way. 对于您的特定问题,我会以这种方式回答。

git checkout master
git pull development

I don't recommend you to delete development branch. 我不建议您删除开发分支。

暂无
暂无

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

相关问题 git:我不小心将功能分支合并到master中,而不是进行合并 - git: I accidentally merged feature branch into master instead of develop 我将分支开发合并到主分支,但在主分支上,开发没有变化 - I merged branches develop into master but on master branch no changes from develop Git:如何删除所有本地分支(合并与否),除了master和develop - Git : How to delete all local branches (merged or not), except master and develop 不知怎的,我的git develop分支被合并到我的主分支中 - Somehow my git develop branch got merged into my master branch 使用git merge --squash将master先前合并到dev中时将development合并到master中? - Using git merge --squash to merge develop into master when master was previously merged into develop? 无意中合并了大师进入开发和推动 - Accidentally merged master into develop and pushed 命令“ git branch --merged master”中的“ master”是什么意思? - What does 'master' mean in command “git branch --merged master”? Git:重新掌握。 怎么办? - Git: Rebased to Master. Now what? 如果我将工作合并到主数据库但没有推送后,有人将新提交提交到git存储库的主数据库,该怎么办? - What shall I do if someone pushed new commits to master of git repository after I merged my work to master but didn't push? 我将提交合并到master中,现在收到有关挑选樱桃的消息。 不胜感激建议做什么是安全的 - I merged a commit into master and am now getting a message about cherry-picking. Would appreciate advise on what is safe to do
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM