Before upgrading to Yosemite, read this first, as your upgrade could potentially take a few hours if you have a large /usr
folder. After the upgrade finishes, log in to OS X and install all updates in the App Store. Once the updates are done, do the following:
xcode-select --install