Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Commit to develop branch directly in Git Flow? [closed]

I'm currently migrating a project to Git Flow and I'm really appreciated the flexibility it provides.

The problem is, in the following situations, may I working on and commit to a development branch directly?

  • a minor typo fix,
  • or a small method-level refactor,
  • or some errors fixes after a feature was merged.

I've read the creator's post and there is no mention of this situation. What you guys doing in real world?

like image 855
Mengdi Gao Avatar asked Jan 05 '15 08:01

Mengdi Gao


People also ask

What is develop branch in git?

A develop branch is created from main. A release branch is created from develop. Feature branches are created from develop. When a feature is complete it is merged into the develop branch. When the release branch is done it is merged into develop and main.

How do you make a commit to a branch?

In order to create a Git branch from a commit, use the “git checkout” command with the “-b” option and specify the branch name as well as the commit to create your branch from. Alternatively, you can use the “git branch” command with the branch name and the commit SHA for the new branch.

How do you push a feature branch to develop?

Push feature branch to remote This command pushes new-feature to the central repository (origin), and the -u flag adds it as a remote tracking branch. After setting up the tracking branch, git push can be invoked without any parameters to automatically push the new-feature branch to the central repository.

How do you finish a feature branch?

From my understanding one of the advantages of creating feature branches is so that you can easily see where large groups of commits have been merged into the develop branch. Upon finishing a feature branch the recommendation is to delete the feature branch since it is no longer needed for development.


2 Answers

Totally. The benefit of isolated feature branches in git flow is primarily for the people who requested them. As long as it is a code change that you are sure is ok to go into the next release, it can be made directly into develop. You don't want to bog down your team with too many feature branches if you can help it.

like image 58
onlythefinestwilldo Avatar answered Sep 19 '22 13:09

onlythefinestwilldo


I think this is up to you. What we've done in our project is try and have everything on a branch and then when we are about to release, merge what we definitely want in the release back to develop. Then we create our release branch from develop. I say we have done everything on a branch but for typos and very minor fixes we dont tend to create a branch.

like image 44
RNJ Avatar answered Sep 18 '22 13:09

RNJ