The only concern I'd have is why master
needs to merge with develop
at all. It should be a fast-forward. That suggests that there's things in master
which are not in develop
, like hot patches, and so you're not developing on top of everything which is in production.
You should have a situation like this:
B - C E - F H - I
/ \ / \ / \
A ----- D ----- G ------ J [develop]
[master]
master
is at D and has had a feature branch (B, C, D) previously merged in. develop
is at J and has had two feature branches merged in. When you git checkout master; git merge develop
it should be a simple fast-forward to J.
If you need a merge, it means master
and develop
have diverged. That probably means someone hot patched master
and that patch hasn't gone back into develop
. For example, the hot patch is E.
B - C E - F H - I
/ \ / \ / \
A ----- D ----- G ------ J [develop]
\
L [master]
Now when you git checkout master; git merge develop
it will need to merge.
B - C E - F H - I
/ \ / \ / \
A ----- D ----- G ------ J [develop]
\ \
L -------------- K [master]
This will continue to happen.
This is more than a nuisance. It means develop
never truly reflects the code that will run in master
after the merge. You're developing and testing on a slightly different code base than what's in production. Eventually you'll merge a fully tested develop
into master
and production will break.
You'll probably want to look and see if there's any commits in master
which are not in develop
using one of these techniques and cherry-pick them into master
.
Alternatively, instead of merging you could rebase
develop onto master, probably using -p
to preserve your feature branches. Then merge (ie. fast forward).
That would go something like this, starting with the hot patched master...
B - C E - F H - I
/ \ / \ / \
A ----- D ----- G ------ J [develop]
\
L [master]
Then git checkout develop; git rebase -p master
.
B - C E1 - F1 H1 - I1
/ \ / \ / \
A ----- D - L ------ G1 ------ J1 [develop]
[master]
Now you can fully test develop
knowing it has everything it will have once "merged" into master
.