Merge one change into multiple branches

I use git and I have a repo with a bunch of branches.

If I make a correction in the main branch (or another branch), how can I easily combine this correction into all these branches. Should I merge each branch one by one (for example: Merging one change into several branches in Git ) or is there an easier way?

+6
source share
3 answers

I would recommend you take a look at git flow and support .

Support for git thread patches creates a bugfix branch that can be merged into your production branch (possibly master ) and the development branch (in git flow develop ). Fixing fixes starts with master . Since all changes to the wizard are merged into develop after each version, you can merge the patch branch into develop without having to merge commits that you were not going to merge.

+2
source

I don’t think there is a way to combine it into several branches with one team. What you can do is ever branch in which you start working, just drag it to master.

0
source

Each merge requires conflict resolution, and sometimes conflict resolution, so there is no way to merge without checking the branch into which you merge. What is written, do you need to merge it into all your branches?

For example, I have dozens of branches locally, but the vast majority of them are isolated functions or fixes. This really doesn’t need most fixes to fix fixes, and I don’t want to keep them up to date until they are ready for production or ready to be shared by co-authors. When they appear, they should be updated, regardless of whether there was a hot master set to facilitate production integration.

In other words, my workflow allows me to propagate the patch merge problem in function branches to the point where it really matters. If you have a bunch of small feature branches, you may not need this patch code.

0
source

Source: https://habr.com/ru/post/923382/


All Articles