Skip to content
Discussion options

You must be logged in to vote

Yeah, GitHub ties the default branch to everything: PR base, clone target, template source. No way to split those today.

For a gitflow setup with templates, the least painful approach I've found is keeping main as default (since that's what template users expect) and then using a branch protection rule + a repo-level PULL_REQUEST_TEMPLATE.md to steer PRs toward develop.

You can't auto-change the PR base branch, but you can add a clear note at the top of your PR template:

<!-- 
  Base branch should be `develop`, not `main`.
  Please change the base before submitting.
-->

Another option: use a GitHub Actions workflow that auto-comments on PRs targeting main with a reminder to retarget to de…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@DanielYang59
Comment options

Answer selected by DanielYang59
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Repositories The core of version-controlled code storage Question Ask and answer questions about GitHub features and usage source:ui Discussions created via Community GitHub templates
3 participants