Get Xcode: Get Xcode 6.3 .
Download and install it, you also need to open Xcode agree to the license and it will install its components.
Get Command Line Tools
To download install Homebrew run the install script on the command line as below and let the script do its thing:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After installing and as suggested in the command line, to check for any issues with the install run:
// To find faults > brew doctor // To search for an application: > brew search // To install > brew install <application-name> // To list all apps installed by Homebrew > brew list // To remove an installed application > brew remove <application-name> // To update Homebrew > brew update // To see what else you can do or Help > man brew //Where does Homebrew install stuff …. in the Cellar /usr/local/Cellar/