1

I use git flow and there are two branches called develop and master How can I create a new branch on develop? Things I do:

git checkout develop
git flow feature start brokerage-branch

But this branch is created on the master

Drew Reese
  • 165,259
  • 14
  • 153
  • 181
zahra zamani
  • 1,323
  • 10
  • 27
  • Does this answer your question? [Git flow - create feature branch off another feature branch](https://stackoverflow.com/questions/22948747/git-flow-create-feature-branch-off-another-feature-branch) – SwissCodeMen Jun 22 '21 at 21:16

3 Answers3

3

The base branch for features (normally develop in Git Flow) can be configured and is likely set to master in your case. You can change it back to develop like this:

git config --local gitflow.branch.develop develop 

When you start a new feature with git flow feature start xyz, it does not matter on what branch you currently are. The new feature branch is created from the configured branch.

Matt
  • 12,848
  • 2
  • 31
  • 53
2

A example demonstrating a Feature Branch Flow is as follows.

git checkout master
git checkout -b develop
git checkout -b feature_branch

and in your case, it should checkout develop branch first and then try creating new feature

git flow init  # initialize gitflow
git branch  # check git branch here
git flow feature start feature_branch  # create feature branch 
Chandella07
  • 2,089
  • 14
  • 22
1

Based on this link http://danielkummer.github.io/git-flow-cheatsheet/

feature start should be created from develop branch