Manage dependent git incomplete functions / branches

Lately, I seem to have this recurring scenario for the development of several feature branches with one feature branch ( feature-b in the figure below) depending on the support of another incomplete function (developed in feature-a ):

 ---o---o--o master | +---o---o---o feature-a | +----o---o feature-b 

Whenever I change feature-a (including an interactive reboot to fix errors in this function), I need to reload feature-b to feature-a . These are local branches, so I can modify them whenever I want.

Most often, I have the following case:

  master testing ---o---o--o-------------------------------------------o---o | feature-a . . +---o---o---o . . | feature-b . . +----o---o ..................... . | feature-c . +----o---o ....................... 

where the test branch is a combination of all the (related) functions that are under development, created by combining all the corresponding branches of features on it (in the figure master , feature-b , feature-c - and feature-a is meant).

Nowadays, especially if you have more complex branching relationships of functions, I always open gitk to visualize the branch relationships and support shell scripts so that this is automatically overwritten, but this method seems to be a fragile and general inconvenience. What I would like to know:

  • Is there a way to describe and even automatically detect branch relations, and then use the same command to try to re-apply the described relationship (in the simple example above, after changing feature-a by rebooting or adding new commits to the head, automatically restart feature-b in the new chapter feature-a ).
  • GUI tool to reinstall branch set to other commits (just giving an error if conflict prevents operation will be ok)?
  • Other ideas for managing this clutter branch? Random complexity involves too much time and depletion of too much brain power.
+6
source share
1 answer

I don’t like pushing bad things so that others can see, and I like to keep the final story looking clean.

This is a bad habit. You must save master and pu for the "proposed updates." Push your commits to pu , and then reformat pu to master if necessary. When the time is right, you can choose a color from pu or even merge pu into master .

Here's how to do it with git repo . Avoid falling "down the rabbit hole" of endless branching.

connected

+3
source

All Articles