brew couldn't upgrade after upgrade xcode 7.3.1 to 8.1
I had similar issue:

brew is not up-to-date even though running brew update returns:

Already up-to-date


Running brew upgrade returns:

Warning: You are using a pre-release version of Xcode.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.



I solved running the following command:
cd &quot;$(brew --repo)&quot; &amp;&amp; git fetch &amp;&amp; git reset --hard origin/master &amp;&amp; brew update --force