As shown in the figure, there are two new functions, which are implemented in branch 1
and branch 2
respectively, and are merged into the develop
branch in turn.
Then the problem came. When I wanted to merge develop
into master
and release it to the production environment, I suddenly found that branch 1
had serious problems and could not be launched in this version, and branch 2
was based on the existing version. merge
was developed by the branch 1
branch of develop
, which means that the code of branch 2
already contains the code of branch 1
.
In such an application scenario, what is the best practice to only change the branch 2
modified code from merge
to master
?
The principle of git is to track each modified file. You can use git log to check the different contents of the specific submission of the version. After modification, try to request merge again.
In principle, you should use hotfix on the master to modify the problem of branch1. After the repair is completed, merge the hotfix back to master and develop, and then merge develop back to branch2
You can refer to this process http://danielkummer.github.io ...