Is it safe in Git to pre-merge master into my feature branch before final merge?

0

Issue

While developing a feature branch locally, it turned out the feature needs huge changes. In order to minimize the amount of work and stress during the merge, I thought of first merging locally master into my branch, resolve all conflicts, and then merge my feature into master – which should then be a fast forward, easy merge.

Does this merge expose any risk of losing someone’s changes? Do you recommend another approach?

Solution

I typically rebase the features on top of master, this makes it easier for the person who needs to merge them. However no matter in what direction you do it – even when you get no merge conflicts you still need to test it. You can never asume it is safe.

Answered By – eckes

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More