For the longest time, I couldn’t get Homebrew to update itself because of (what it said was) a ton of uncommitted local modifications. brew doctor simply threw an error telling me to stash the uncommitted modifications that I had made, but told me the wrong directory to look in as my Homebrew repository was clearly not /usr/local as many other Google results had said.

error: Your local changes to the following files would be overwritten by merge:
  CODEOFCONDUCT.md
  LIBRARY.md
  Library/Contributions/example-formula.rb
  Library/ENV/4.3/cc
  ... (a few dozen more files)

I remember this started after I upgraded to OS X 10.9 which, at the time, broke Homebrew, and I did some series of modifications I found on a forum that made it almost-work. This is probably where the problem originated.

Eventually, I found this homebrew issue, which was solved with the following dance:

cd $(brew --repository)
sudo chown -R $USER .
git reset --hard origin/master
brew update

Effectively, this finds your actual Homebrew repository, re-assigns ownership to your developer account and then wipes out all local modifications so that Homebrew doesn’t freak out when it tries to merge the upstream modifications from its master list of packages.

Now everything is great and I can continue installing ASP.NET 5 on my Mac.