hg-flow and appharbor

i have noticed that appharbor deploys on anything named master or default, is there anyway i can change hg-flow to use different branch names now that i am already using it

currently i have

- default (gets deployed by appharbor automatically

- develop (gets built but not deployed)

- master (gets deployed by appharbor automatically)

I think I need to rename master to something else in hg-flow, in fact what does the master branch get used for?

brilliant product by the way :)

5 answers

1 accepted

1 vote
Accepted answer

If you're running Mercurial you should only have a 'default' branch rather than a 'master' branch (the latter being a git convention). Both of the 'flows' have a concept of a 'production branch' which is the one that you deploy - it defaults to 'master' on git-flow and 'default' on hg-flow, so this should all work out correctly with AppHarbor. Are you saying you have a 'default' AND a 'master' branch? If so I'm not sure how that's happened, that's not the standard setup.

Is it that you configured the production branch to be 'master' when you initialised hg-flow? As I say, SourceTree should have initialised it to 'default' if you initialised hg-flow in it.

You can change which branch is which but you have to be quite careful to keep things consistent. You can edit the '.flow' file in the root of your repository, and the production branch is the line that says "master = blah" (I know, 'master' is confusing here - I wish they'd called it "production = blah"). Usually, that would say "master = default" for the standard hg-flow setup, but it can be different. Personally, I like to stick to the standard setup, it's simpler.

If you change it, you have to make sure that whatever you change it to is an existing branch, and is at the correct point in the history to reflect your production build. Then you can edit the .flow file, save and commit.

Unfortunately you also then have to switch to *every* open branch, make the same change to the .flow file, and save/commit. This is *vital*. If you don't do this, you could have an inconsistent hg-flow configuration depending on what branch you're currently on, which is a potential source of massive pain.


thank you that seems to have worked a treat!

awesome stuff...

thanks. great product, great flow, great support and by the looks of things great community


so just for the record, i didnt choose a git workflow on purpose as mercurial was the choice i made after leaving svn (ex windows dev). however i am very mouse click happy so definitley didnt read any instructions or anything so this probably isnt a bug but a click happy developer issue :)

thanks again!

firstly thanks for such a quick and detailed response! so master is something that just appeared when I installed the latest version of the software on my mac, I don't really want it as I've been used to default as my production branch (my only branch up until hg-flow) ok so I'm at home now and I'll try your suggestions to get rid of master and use default as my production branch which is exactly what I want. I'll post my findings here tomorrow thanks again john

gahh i cannot get rid of master!!

it will not go away!

wait.... i think its gone, just really follwed steves instructions but had to merge and commit and push so all 3 branches were the same.

then i could close, commit and push the master branch leaving me with.....

default - (production and appharbor branch)

deveolopment (well you get the idea)

awesome stuff...

thanks. great product, great flow, great support and by the looks of things great community


I ran a quick test with a new hg repo, clicking 'Hg Flow' brings up the initialisation settings with the 'default' branch chosen as the production branch, and accepting that definitely uses 'default' and doesn't create a 'master' branch. So not sure what happened there, perhaps you accidentally typed 'master' in the top field after reading some documentation that referred to it like that?

Anyway, glad you have it sorted out now.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,100 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you