Note: This page has been copied from https://github.com/OSGeo/homebrew-osgeo4mac/wiki/Developing-on-QGIS-using-OSGeo4Mac and includes my notes. The original text is written by @dakcarto.
In addition to using this tap to install a QGIS stable formula, you can also use it to fully set up a development environment for an externally built QGIS from a clone of the current development (master) branch of the source code tree.
Note: This setup, though heavily tested, is currently experimental and may change. A more stable and time-tested setup is outlined in the QGIS INSTALL document.