Hub: How do I change default merge target to develop, rather than master (for hub sync)?

Created on 8 Nov 2019  路  5Comments  路  Source: github/hub

Sorry in advance if this has been answered somewhere else, but I couldn't find an answer in the README or the existing issues.

When I run hub sync I often get this warning:

warning: 'feature/my-feature-name' was deleted on origin, but appears not merged into 'master'

However, in my projects we don't merge branches into master, we merge them into develop. Branches are only merged into master after a release.

Is it possible to configure hub sync to consider develop the target branch for merges rather than master?

Most helpful comment

Hub detects the default branch for a repository like this: git symbolic-ref refs/remotes/origin/HEAD

This will likely be "master" for your repository. You can change it to "develop":

git remote set-head origin develop

Note that this might affect other hub commands too:

  • The default base for hub pull-request will now be "develop"

All 5 comments

Hub detects the default branch for a repository like this: git symbolic-ref refs/remotes/origin/HEAD

This will likely be "master" for your repository. You can change it to "develop":

git remote set-head origin develop

Note that this might affect other hub commands too:

  • The default base for hub pull-request will now be "develop"

Nice, thanks! Good to hear it was a quick fix.

Is this documented anywhere?

@hubro No. Perhaps someone could add a short section about default branches to both pull-request.go and sync.go help text?

Which other commands might this affect?

@atwright147 None that I can think of

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dsifford picture dsifford  路  4Comments

iserko picture iserko  路  4Comments

Kristinita picture Kristinita  路  4Comments

DennisSchiefer picture DennisSchiefer  路  4Comments

cbeams picture cbeams  路  4Comments