In order to install any developer, you will need to install Xcode (https://developer.apple.com/xcode/), which is a nearly 4 GB developer suite. Apple offers this for free from the Mac App Store. In order to install Git and the GitHub setup, you will need certain command-line tools, which are part of the Xcode development tools.
If you have enough space, download and install Xcode, which is basically a complete package of development tools.
You will need to create an Apple developer account at developer.apple.com in order to download command-line tools. Once you have set up your account, you can select the command-line tools or Xcode based on the version, as follows:
If you are on OS X 10.7.x, download the 10.7 command-line tools. If you are on OS X 10.8.x, download the 10.8 command-line tools.
Once it is downloaded, open the DMG file, and follow the instructions to install it.