Mac upgrade git and configure Git

Source: Internet
Author: User
Tags install brew

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.