After an interrupted brew update because of a network issue, Homebrew appears to be broken:
brew update
$ brew update error: pathspec \'master\' did not match a
What solved Homebrew git errors for me was simply to cd ~ and run brew update in my home directory. The command failed when I was in a folder shared on GitHub. Also, clang magically appeared again from brew config after cd ~.
cd ~
clang
brew config