3

While using SourceTree I renamed the two main local branches (master and develop).
However, when I now click on the Git Flow icon to start a new feature, it tells me that the repository needs to be initialized (even though it has been already been initialized).
Additionally, the REPOSITORY -> GIT FLOW -> INITIALIZE REPOSITORY menu item is greyed out.

I tried putting the names of the branches back and git flow works again!

So, how do I rename the branches and keep git flow working?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Sean M.
  • 33
  • 2

1 Answers1

2

Shut Sourcetree, and edit the file .git/config (within the repository) updating the [gitflow "branch"] section. The .git directory is sometimes hidden within file explorer.

The default will look something like this:

[gitflow "branch"]
master = master
develop = develop

And you should change it to match your new branch names, i.e.:

[gitflow "branch"]
master = yourNewMasterBranchName
develop = yourNewDevelopBranchName

Then restart SourceTree

Russ
  • 138
  • 1
  • 5