Git stream creation function - separate another function branch

I used git flow for a while. I am curious about a specific use case.

For one of my projects, I have a ticket for a new website feature. This ticket depends on many sub-tasks. I would like to create a function branch for the main ticket, and then for each subtask create a function branch of the parent function branch.

Suppose I have a PROJ-500 ticket and I create a feature branch for it

 git flow feature start PROJ-500 

Then I want to integrate PROJ-501 tickets through PROJ-515 into PROJ-500 , before integrating all this into develop . Is there a way to do something like

 git flow feature start PROJ-511 -b PROJ-500 

Then overtime, these subtasks are completed, and when their function is completed, the branch is combined in the PROJ-500 .

 git flow feature finish PROJ-511 

The above command will integrate the PROJ-511 into the PROJ-500

And once all the subtasks are completed, the PROJ-500 will be completed and combined with develop .

Thus, the new function of the website is integrated into the development as a whole, and not in parts.

+55
git git-flow
Apr 08 '14 at 21:41
source share
4 answers

You can create a child branch with

 git flow feature start PROJ-511 feature/PROJ-500 

But you cannot use the GitFlow tool to merge the branch back into the main branch of the function, because if you do

 git flow feature finish PROJ-511 

the function will be combined into develop . Ergo auxiliary functions are not supported , you need to do this manually.

Alternatives: The requirement is not new. There is an open problem, as well as a fork project that requires support for finish functions in branches other than develop . I also found a pull request with an implementation of this function. You can try this modification and see if you are happy with it.

+62
Dec 08
source share

As I understand it, gitflow is completely abandoned.

gitflow-avh replaces it and offers this function (see https://github.com/petervanderdoes/gitflow#creating-featurereleasehotfixsupport-branches ).

I just try and it works well for me.

 git flow feature start PROJ-511 feature/PROJ-500 git flow feature finish PROJ-511 

The PROJ-511 has been combined with the / PROJ-500 function.

+15
Mar 30 '15 at 18:44
source share

I don't think there is a method for this in the git thread, but it is pretty simple using only git.

 git checkout PROJ-500 git checkout -b PROJ-511 ...do your PROJ-511 work... git checkout PROJ-500 git merge PROJ-511 git branch -d PROJ-511 
+7
Apr 08 '14 at 9:55
source share

As already mentioned, we can start a new function using any base branch with

 git flow feature start PROJ-511 feature/PROJ-500 

And to complete the helper function, we can temporarily change the configuration of the git thread to use our function branch instead of develop :

 git flow config set develop feature/PROJ-500 && git flow feature finish PROJ-511 

Thus, the git thread executes all the commands and health checks. Finally, to restore config, we can run

 git flow config set develop develop 
+3
Jun 06 '16 at 23:29
source share



All Articles