Merge a branch with Git Flow keeping the branch still alive

强颜欢笑 提交于 2019-12-03 12:18:47

问题


I'm starting using git flow and I understand that doing:

git flow feature start my-feature
git flow feature finish my-feature

I create a feature and then, when i've finished my changes, I merge it with the develop branch. The finish flow command literally delete the feature branch after the merge action.

My question is: is there any way using git flow to merge my feature with develop without deleting it after merge.

And my second question would be: is this workflow correct? I mean, is it right keeping alive feature branches while merging with develop, just to update the 'main' branch with some changes and keeping to work on the feature branch?


回答1:


Simply use git flow feature finish -k my-feature

Reference: https://github.com/nvie/gitflow/wiki/Command-Line-Arguments

About your second question:

You normally don't merge feature branches repeatedly into develop. You merge develop into the feature branches (i.e. the other way around) or rebase the feature branches onto the HEAD of develop (recommended). The only time when you merge a feature branch into develop is when you finished the development of the feature.
If you merge feature branches into develop you completely remove the benefit of having a feature branch and you just could have developed directly on develop.
If you feel you have the need to merge from a feature branch into develop you most likely made changes that are not directly related to that specific feature and should have been made in develop in the first place.



来源:https://stackoverflow.com/questions/16440433/merge-a-branch-with-git-flow-keeping-the-branch-still-alive

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!