The following commands are used by Homebrew contributors to set up a fork of Homebrew’s Git repository on GitHub, create a new branch and create a GitHub pull request (“PR”) of the changes in that branch.
Depending on the change you want to make, you need to send the pull request to the appropriate one of Homebrew’s main repositories. If you want to submit a change to Homebrew core code (the brew
implementation), you should open the pull request on Homebrew/brew. If you want to submit a change for a formula, you should open the pull request on the homebrew/core
tap or another official tap, based on the formula type.
brew bump-formula-pr
to do everything (i.e. forking, committing, pushing) with a single command. Run brew bump-formula-pr --help
to learn more.brew
code related pull requestcd $(brew --repository)
.git remote add <YOUR_USERNAME> https://github.com/<YOUR_USERNAME>/brew.git
. <YOUR_USERNAME>
is your GitHub username, not your local machine username.cd $(brew --repository homebrew/core)
.git remote add <YOUR_USERNAME> https://github.com/<YOUR_USERNAME>/homebrew-core.git
<YOUR_USERNAME>
is your GitHub username, not your local machine username.For formulae in central taps other than homebrew/core
, such as homebrew/php
, substitute that tap’s name for homebrew/core
in each step, and alter the GitHub repository URLs as necessary.
To make a new branch and submit it for review, create a GitHub pull request with the following steps:
master
branch with git checkout master
.master
branch with brew update
.master
branch with git checkout -b <YOUR_BRANCH_NAME> origin/master
.brew edit
or your favorite text editor, following all the guidelines in the Formula Cookbook. bottle do
block in the formula, don’t remove or change it; we’ll update it when we pull your PR.brew audit
step while your changed formula is installed. brew tests
brew install --build-from-source <CHANGED_FORMULA>
brew test <CHANGED_FORMULA>
brew audit --strict <CHANGED_FORMULA>
git add
and git commit
.git push --set-upstream <YOUR_USERNAME> <YOUR_BRANCH_NAME>
.<FORMULA_NAME> <NEW_VERSION>
”, e.g. “source-highlight 3.1.8
”. devel
version updates should have the commit message suffixed with (devel)
, e.g. “nginx 1.9.1 (devel)
”. If updating both stable
and devel
, the format should be a concatenation of these two forms, e.g. “x264 r2699, r2705 (devel)
”.Thank you!
To respond well to feedback:
needs response
label on a PR means that the Homebrew maintainers need you to respond to previous comments.To make changes based on feedback:
git checkout <YOUR_BRANCH_NAME>
.git add
and git commit
.git rebase --interactive origin/master
.git push --force
.If you are working on a PR for a single formula, git commit --amend
is a convenient way of keeping your commits squashed as you go.
Once all feedback has been addressed and if it’s a change we want to include (we include most changes), then we’ll add your commit to Homebrew. Note that the PR status may show up as “Closed” instead of “Merged” because of the way we merge contributions. Don’t worry: you will still get author credit in the actual merged commit.
Well done, you are now a Homebrew contributor!
© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request.html