Pergunta

Is "develop" branch in git flow branching model shared by different people? So we have to manually push "develop" and pull it to merge?

Or each person have his "develop" branch and people need to get "feature" branch by "git flow feature publish" and "git flow feature pull"?

Which way is correct in using git flow branching model?

Foi útil?

Solução 2

In Git Flow, the develop branch is one of the long-running branches that "everyone should share." This implies two things:

  1. Work should not be done on develop, but in feature branches branching off of develop.
  2. Changes to develop, such as merged feature branches, should generally be made public quickly.

If everyone were to have their own develop branch, this would be very disorganized, especially in the merge-commit history!

Outras dicas

To extend a little more what thirtythreeforty said:

Develop contains unstable code. When you want to create a new feature you create a separate FROM develop

git checkout develop
git checkout -b feature/123-name-of-feature

After you have finished your work and you have already added and committed your work (i.e. git add && git commit), now it's time to merge your branch to develop, the best practices suggest to use no fast forward btw.

git checkout develop
git merge --no-ff feature/123-name-of-feature
git push origin develop

Now everyone can pull develop and repeat this cycle. Of course, I am skipping the process of merging to qa, stage and master because I don't know your git workflow.

As a suggestion, I will give you a document explaining the git Workflow that we use in my job

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top