Yes! It’s easy! If brew tap doesn’t show homebrew/core, set yourself up to edit a local copy:
Set HOMEBREW_NO_INSTALL_FROM_API=1 in your shell environment,
Run brew tap --force homebrew/core and wait for the clone to complete, then
Run brew edit <formula> to open the formula in EDITOR.
You don’t have to submit modifications back to homebrew/core, just edit the formula to what you personally need and brew install <formula>. As a bonus, brew update will merge your changes with upstream so you can still keep the formula up-to-date with your personal modifications!
Note that if you are editing a core formula or cask you must set HOMEBREW_NO_INSTALL_FROM_API=1 before using brew install or brew update otherwise they will ignore your local changes and default to the API.
To undo all changes you have made to any of Homebrew’s repositories, run brew update-reset. It will revert to the upstream state on all Homebrew’s repositories.
更多brew常见问题文档FAQ (Frequently Asked Questions) — Homebrew Documentation