Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

git-branch

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?

like image 315
user776686 Avatar asked Sep 29 '22 07:09

user776686


1 Answers

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.

like image 156
eckes Avatar answered Oct 03 '22 06:10

eckes