pr-branch-non-default
Included in configs: ✅ recommended, 🔒 strict
Sending a PR from a repository’s default branch, commonly main
, means that repository will have a hard time pulling in updates from the upstream repository.
It’s generally recommended to instead create a new branch per pull request.
”Base” and “Head”
Section titled “”Base” and “Head””Two terms are useful to know when working with forked repositories and pull requests:
- “Base”: The main repository that receives the pull request.
- Your local Git clone likely refers to this as “upstream”.
- “Head”: Your fork that is sending the pull request.
- Your local Git clone likely refers to this as “origin”.
Suggested Steps
Section titled “Suggested Steps”GitHub does not provide a way to change the head branch of a pull request. You’ll want to:
- Create a new branch on the head repository
- Close the original pull request on GitHub
- Send a new pull request from that branch
Examples
Section titled “Examples”PR sent from a default main
branch:
[pr-branch-non-default]
This PR is sent from the head repository’s default branch. Sending a PR from a default branch means the head repository can’t easily be updated after the PR is merged. Sending a PR from a repository’s default branch, commonly
main
, means that repository will have a hard time pulling in updates from the upstream repository. It’s generally recommended to instead create a new branch per pull request. You’ll need to: