Mac system comes with git, but comes with git version is very old, there is no automatic hint and GITK and other functions, if one to install very laborious.
We used brew to install git very handy, but we found that it didn't work after the installation because the default git is still in the old version.
in order to solve the same problems as I do, I now write down my solution and hope to help everyone.
1. Install brew First, then install git, brew install git
2. Back up the old git directory, cd/usr/local/bin
LS git*
mkdir Backup-git
MV Git*./backup-git/
3. Go to the new git directory. cd/usr/local/cellar/git/2.1.3
See that Git is installed successfully
4. CD ~
5. Vim. Bash_profile Add Export git=/usr/local/cellar/git/2.1.3
Export path= $GIT/bin: $PATH
6. Refresh the environment variable source. bash_profile
The installation is successful and you can experience the latest version of Git functionality.
Mac upgrade git and configure Git