There are now two branches, namely branch A and branch B. There are several submissions on each branch;
The commits of branch A include a1, a2, a3, a4, a5, a total of five submissions;
The commits of branch B include b1, b2, b3, b4, b5, there are five submissions in total;
is currently on branch A.
Note: The hash values of the above 10 submissions are different.
Excuse me: How can I only pull the b2, b3, and b4 commit nodes of branch B to branch A?
Requires that after pulling to branch A, the original commit information on branch B must be retained.
Please break ╮( ̄▽  ̄)╭ ~
The cherry-pick
method mentioned by @junnplus is correct, and I can do it too; but is there a better answer?
On branch A, execute
If automation is not required, the most convenient way is this:
The editor will display five lines from b1 to b5, delete the two lines b1 and b5, save and exit.
It may be difficult to have a better answer, right? According to the
git-flow
的原则,dev-feature
一般不会有只合并中间几次提交到dev
divided situation, maybe the subject's need is based on unreasonable version management strategy or very special scenarios.Should only be chrry pick
Everyone is right, there is no good way; but I still have this special need in my actual work process.
Tonight I used my poor shell programming skills to write a program that can achieve my needs, and it can be achieved through
cherry-pick
.This small program can fulfill my needs as long as it is executed as follows:
Next is my debut: github link