简体   繁体   English

将更改从master转移到development分支(使用GIT)

[英]Move changes from master to develop branch (using GIT)

The way I use GIT when developing a new feature or fixing a bug is to create a new branch from the master branch to work on then, once I have finished developing on that branch, merge it back into the master branch. 开发新功能或修复错误时,我使用GIT的方式是从master分支创建一个新分支进行处理,一旦完成该分支的开发,便将其合并回master分支。

Now, lets say I have the master , bug_fix_1 , feature_1 and feature_2 branches. 现在,假设我有masterbug_fix_1feature_1feature_2分支。 The development of feature_1 has been put on the back-burner because feature_2 became a priority. Feature_1的开发工作被搁置一旁,因为Feature_2成为了优先事项。 The bug_fix_1 has now been fixed and merged back into master. bug_fix_1现在已修复,并重新合并到master中。 The feature_2 branch has also now been completed and merged back into master. 现在,feature_2分支也已完成并合并回master。 As a result I have deleted both these branches and am now left with master and feature_1. 结果,我删除了这两个分支,现在剩下master和feature_1了。

How do I get the changes from bug_fix_1 and feature_2 (now in the master branch) into the feature_1 branch? 如何将更改从bug_fix_1feature_2 (现在位于master分支)更改为feature_1分支?

You already merged bug_fix_1 and feature_2 branches with master , 您已经将bug_fix_1feature_2分支与master合并了,

then your master has all the changes from bug_fix_1 and feature_2 那么您的主人就拥有了bug_fix_1和feature_2的所有更改

git checkout feature_1 git checkout功能_1

git merge master git合并大师

Something like this: 像这样:

 git checkout feature_1 git merge bug_fix_1 git merge feature_2 

Or am I missing something? 还是我错过了什么?

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

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