As in the title. If you don't do that, you'll get:
error: Your local changes to the following files would be overwritten by merge: Library/Formula/redis.rb Please, commit your changes or stash them before you can merge. Aborting
Here is one-liner:
git --work-tree=$(brew --prefix) commit -a -m "potato"