How to upgrade Git to latest version on macOS?

前端 未结 15 1808
离开以前
离开以前 2020-12-02 03:57

I just bought a new Mac with OS X Lion and I checked in the Terminal what version of git is installed by default. I got the answer

git --version
> git ver         


        
15条回答
  •  离开以前
    2020-12-02 04:31

    It would probably be better if you added:

    export PATH=/usr/local/git/bin:/usr/local/sbin:$PATH
    

    to a file named .bashrc in your home folder. This way any other software that you might install in /usr/local/git/bin will also be found first.

    For an easy way to do this just type:

    echo "export PATH=/usr/local/git/bin:/usr/local/sbin:$PATH" >> ~/.bashrc
    

    into the Terminal and it will do it for you.

提交回复
热议问题