2016-04-03 11:59:20 +00:00
# Contributing to Homebrew
2019-05-23 08:11:45 +00:00
First time contributing to Homebrew? Read our [Code of Conduct ](https://github.com/Homebrew/.github/blob/master/CODE_OF_CONDUCT.md#code-of-conduct ).
2016-04-03 11:59:20 +00:00
2019-01-24 23:33:05 +00:00
### To report a bug
2016-04-03 11:59:20 +00:00
* run `brew update` (twice)
* run and read `brew doctor`
2018-02-23 14:48:48 +00:00
* read [the Troubleshooting Checklist ](https://docs.brew.sh/Troubleshooting )
2016-04-03 11:59:20 +00:00
* open an issue on the formula's repository
2019-01-24 23:33:05 +00:00
### To submit a version upgrade for the `foo` formula
2016-04-03 11:59:20 +00:00
* check if the same upgrade has been already submitted by [searching the open pull requests for `foo` ](https://github.com/Homebrew/homebrew-core/pulls?utf8=✓&q=is%3Apr+is%3Aopen+foo ).
2017-01-02 19:17:28 +00:00
* `brew bump-formula-pr --strict foo` with `--url=...` and `--sha256=...` or `--tag=...` and `--revision=...` arguments.
2016-04-03 11:59:20 +00:00
2019-01-24 23:33:05 +00:00
### To add a new formula for `foo` version `2.3.4` from `$URL`
2016-04-03 11:59:20 +00:00
2018-02-23 14:48:48 +00:00
* read [the Formula Cookbook ](https://docs.brew.sh/Formula-Cookbook ) or: `brew create $URL` and make edits
2016-10-30 17:28:45 +00:00
* `brew install --build-from-source foo`
2016-08-14 13:17:43 +00:00
* `brew audit --new-formula foo`
2016-04-03 11:59:20 +00:00
* `git commit` with message formatted `foo 2.3.4 (new formula)`
2018-02-23 14:48:48 +00:00
* [open a pull request ](https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request ) and fix any failing tests
2016-04-03 11:59:20 +00:00
2019-01-24 23:33:05 +00:00
### To contribute a fix to the `foo` formula
If you are already well versed in the use of `git` , then you can find the local
copy of the `homebrew-core` repository in this directory
(`$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/`), modify the formula there
leaving the section `bottle do ... end` unchanged, and prepare a pull request
as you usually do. Before submitting your pull request, be sure to test it
with these commands:
```
brew uninstall --force foo
brew install --build-from-source foo
brew test foo
brew audit --strict foo
```
After testing, if you think it is needed to force the corresponding bottles to be
rebuilt and redistributed, add a line of the form `revision 1` to the formula,
or add 1 to the revision number already present.
If you are not already well versed in the use of `git` , then you may learn
about it from the introduction at
https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request and then proceed as
follows:
* run `brew edit foo` and make edits
* leave the section `bottle do ... end` unchanged
* test your changes using the commands listed above
* run `git commit` with message formatted `foo <insert new version number>` or `foo: <insert details>`
* open a pull request as described in the introduction linked to above, wait for the automated test results, and fix any failing tests
2016-04-03 11:59:20 +00:00
Thanks!