XCode
As an alternative to using XCodes git version you can also install newer versions with brew!
For the command line tools (like git etc.) you need to install XCode from the AppStore first and agree to the license.
After installing just type
git
into the Terminal. After this the license dialog which you need to agree to, will show up.
You can also install the complete XCode command line tools (like C-Compiler etc) with:
xcode-select --install