Merge Request Process Question
The question is with respect to the following process used to “re-baseline” feature2
with feature1
. I am wondering if I have not understood something about how this merge process might cause problems.
A diagram is at the bottom of the page. There are 3 branches of interest:
-
feature1
: mercury_forecasting in the diagram -
fetaure2
: forecasting_fas in the diagram -
rebaseline
: rebaseline_forecasting_fas in the diagram
On day 1 I follow the process detailed below. When I merge feature1
into feature2
there are no merge conflicts. Instead of pushing directly to feature2
I check out a new branch (rebaseline
) off of feature2
so that when I push I can open up a merge request. This is instead of updating feature2
directly without a merge request.
On day 2 the same process is followed, but conflicts arise on this merge. I believe this happens because feature1
and feature2
have diverged by day 2. As you see they are resolved and committed on feature1
, and only then is the rebaseline
checked out and pushed up. At this point it should be a snapshot of feature2
, and there should be no diff between the 3 branches.
Some of my colleagues believe that the merging on day 1 causes the conflicts at day 2. I just don’t understand how this might be a problem.
Day 1
$ get fetch --all
$ git checkout feature1
$ git reset --hard origin/feature1
$ git pull origin feature1
$
$ git checkout feature2
$ git reset --hard origin/feature2
$ git pull origin feature2
$
$ git merge feature1
$
$ git push feature2
Day 2
$ get fetch --all
$ git checkout feature1
$ git reset --hard origin/feature1
$ git pull origin feature1
$
$ git checkout feature2
$ git reset --hard origin/feature2
$ git pull origin feature2
$
$ git merge feature1
Resolve conflicts.
$ git add --all .
$ git commit "Commit message."
$ git checkout -b rebaseline_branch
$
$ git push rebaseline_branch