I have 13 branches, I fixed bug in master branch and need to merge those changes to those 13 branches, can I do it whitout checkout to every branch and merge master?
Asked
Active
Viewed 80 times
-1
-
2I don't believe there's an integrated way to do it. You could probably script it... – roelofs Nov 22 '17 at 07:28
-
I would script it. – Israel Zinc Nov 22 '17 at 07:28
-
1Possible duplicate of [Push commits to another branch](https://stackoverflow.com/questions/13897717/push-commits-to-another-branch) – GolezTrol Nov 22 '17 at 07:28
-
Possible duplicate of [Merging one change into multiple branches](https://stackoverflow.com/questions/12054540/merging-one-change-into-multiple-branches) – roelofs Nov 22 '17 at 07:30
-
And some interesting trick to push changes to local. You still have to do it for each branch, but with one command only instead of checking out the branch first: [How to merge the current branch into another branch](https://stackoverflow.com/questions/3672073/how-to-merge-the-current-branch-into-another-branch) – GolezTrol Nov 22 '17 at 07:30
-
Possible duplicate of [Merge, update, and pull Git branches without using checkouts](https://stackoverflow.com/questions/3216360/merge-update-and-pull-git-branches-without-using-checkouts) – smerlung Nov 22 '17 at 07:58
1 Answers
0
One possibility would be:
- to establish a bare repo where you can push your master branch.
- have a post-receive hook (see githooks man page) on that bare repo which will then push master on every "feature" repo you want
- have a post-receive hook per feature repo to begin:
- a rebase of your feature branch on top of master (fine if you did not yet pushed your feature branch elsewhere)
- or a merge of master on your feature branch.
You will still need to get to your feature repo and check if the rebase or merge is not blocked due to some merge conflicts.

Neha
- 3,456
- 3
- 14
- 26