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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With