I have three branches first
, second
, and master
:
D---E---F first
/
A---B---...---C---... master
\
G---H second
first
is a final version and is waiting to be merged intomaster
as a single squashed commit.second
is still under development.
I want to regularly check if second
merged with first
will still work properly after new commits appear in second
.
I have two repositories:
- At
repo1
I simply add new commitsI
andJ
tosecond
and push them toorigin
. - At
repo2
my working branch issecond
, which has been rebased ontofirst
. I am never going to push it at all,repo2
is needed only for local build checks.
repo1
D---E---F first
/
A---B---...---C---... master
\
G---H---I---J second, origin/second
repo2
$ git checkout second
$ git rebase first
D---E---F first
/
A---B---...---C---... master
\
D'--E'--F'--B'--...---C'--G---H second
The important thing is that commit E
(E'
) causes a long-time rebuild of the whole project, so I want it to never be reapplied again and stay where it is.
That's why I can't use:
git pull -r
on second
because it would rearrange all commits and result in this
repo2
A---B---...---C---G---H---I---J---D'--E'--F' second
Also, I can't use fast-forwarded pull because second
in repo2
and origin/second
diverge. But my guess is that something like fast-forwarded pull is indeed possible. It should result in the following:
repo2
D---E---F first
/
A---B---...---C---... master
\
D'--E'--F'--B'--...---C'--G---H---I---J second
Can I somehow imitate it with some sequence of Git commands?