Should "merge commit" be merged back into the dev branch?

Viewed 631

We use Gitlab for our project, and we have two long-lived branches: dev and master, similar to the Git Flow. And We're using the "merge commit" method, which will create a merge commit in the master branch.

However, the master branch will always ahead of the dev branch because of those "merge commit".

enter image description here

so, my question is, should I merge those "merge commit" back to the dev branch? And Why?

2 Answers

Should “merge commit” be merged back into the dev branch?

No, unless you want dev to get changes from master (which could have been modified from other branches, like an hotfix)

If dev is long-lived, you merge it to master, but you don't merge master to dev.

Is your dev branch like the master branch ? If you want to have a branch based on the master, you can use :

$ git checkout -b branchname master

Or if you want to update a branch with the master branch, you can use :

$ git merge branchToUpdate master

Related