How to upgrade Git to latest version on macOS?

前端 未结 15 1820
离开以前
离开以前 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:55

    You need to adjust shell path , the path will be set in either .bashrc or .bash_profile in your home directory, more likely .bash_profile.

    So add into the path similar to the below and keep what you already have in the path, each segment is separated by a colon:

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

提交回复
热议问题