Update for newer versions:
The command line versions can now be installed straight from the command line itself;
- Open "Terminal" (it is located in Applications/Utilities)
- In the terminal window, run the command
xcode-select --install
- In the windows that pops up, click
Install
, and agree to the Terms of Service.
Once the installation is complete, the command line utilities should be set up property.
Older versions:
Installing recent Xcode versions confusingly enough does not automatically install the command line tools. To install the command line tools when they're not automatically installed;
- Start Xcode.
- Go to Xcode/Preferences.
- Click the "Downloads" tab.
- Click "Components".
- Click "Install" on the command line tools line.
That will install the command line tools and make them accessible from a regular command line.