Wednesday, October 21, 2015

How to merge the changes from your development branch to master/release branch

$ git checkout development
$ git merge -s ours release  //merge release into development and discard any changes on release branch
$ git checkout release
 $git merge development

Note: Very important point here is, we are completely discarding the changes which are made in release branch. Here we will just bring all the changes from development branch to release branch without having conflicts. If any conflicts during the merge it will take development changes and ignore the release changes if any.

This merge strategy can be used ONLY when you are sure that release branch does not have any additional git commits compared to development branch. 

If release branch is having specific commits and which are not there in development branch, then it's better to go always with the default merge strategy.

$ git checkout release
$ git merge development

Resolve any conflicts if any and commit it.

No comments:

Post a Comment