V
V
Vlad Zaitsev2017-10-20 17:46:18
git
Vlad Zaitsev, 2017-10-20 17:46:18

Synchronizing changes across multiple branches, how to do it?

There is a project that uses GIT. Until some time, there was one branch that was simply pushed to github, and to a local server.
Now some modules have appeared in the project that we do not want to share, however, we want to continue uploading fixes for existing glitches and new features to github.
The matter is complicated by the fact that in the local develop branch you want to commit more often - after each major fix, it's easier to keep track of which fix something broke, or return to the previous version of the code. However, it is better to send large commits with ready-made functions to the github and the local server - this way it is easier for people from the outside to track what has changed.
In total, we get three entities - the develop branch, into which any changes fall, stable-local, in which all the code is located, but in which the commits look like "made a new feature", in contrast to "removed the variable, rewrote the function, corrected the code style here" in develop, and stable-public, where everything is the same, but some of the commits from stable-local do not get there.
How to make it easier/better?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
savant, 2017-10-20
@savant

TLDR: rebase + squash + cherry-pick
If a little more detailed: you commit as much as you like into devel, when you merge into stable-local you do a rebase devel relative to stable-local + squash (the essence is you combine a bunch of small ones into one) extra commits and merge into stable -public you are already cherry-picking what should go to public.
Or another option: keep stable-public as the main branch and do all of the above relative to it, and regularly rebase stable-local with non-public modules relative to stable-public.
Third option: move non-public to a separate repository and use submodules/subtrees

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question