0

Every month We create release branch out of develop branch. Every commit goes into release branch should be merged with develop branch also. As of now we are merging manually. Is there any way to merge release branch into develop automatically.

If automatic merge is possible can I ignore specific files from being merged? Can we setup a jenkins job to achieve this?

Paul
  • 317
  • 4
  • 15
  • Are you using Git Flow or similar? If yes, do you wish to automate merging `release` into `develop` after any new commit on `release`, or only after `release` is merged into `main/master` and possibly sooner on demand? (I would recommend the latter to avoid cluttering `develop` with multiple back merges that are typically unnecessary.) Another way to ask this is, what would be the trigger for running the automatic merge? – TTT Jul 27 '21 at 14:59
  • Regarding the specific files to ignore from the merge, is the reason to ignore because they cause conflicts, or because you would always take the version from `develop` regardless (or both)? – TTT Jul 27 '21 at 15:01
  • We are not using git flow but using ALM. The trigger should be new commit. – Paul Jul 27 '21 at 16:53
  • The reason to avoid few files is because they may cause conflicts and I should always pick develop version. – Paul Jul 27 '21 at 16:54
  • By ALM do you mean Application Lifecycle Management? (I'm not aware of a specific branching strategy called that or what it would be.) But anyway- new commit, OK. – TTT Jul 27 '21 at 17:22
  • The branching strategy is the main code is available in develop branch and every month we create release/** branch. All the commits that go inside release/** should also go to develop. Any possible way? – Paul Jul 27 '21 at 18:05
  • Yes, it's definitely possible. The "ignore specific files" piece will make it slightly more complicated, but still doable. My advice would be to script out the merge that you do manually, and then automate it to trigger on new commits (this part is common). – TTT Jul 27 '21 at 18:29

1 Answers1

0

There are plugins for this depending on what you are using for instance java with maven has some, please have a look here: What's the right maven command for releasing from release branch to master with gitflow-maven-plugin?

When you say, ignore specific files, do you mean to ignore them "mergewise", or simply don't commit them? If so, is using .gitignore a bad idea?

xalves
  • 320
  • 1
  • 18