How to upgrade Git to latest version on macOS?

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

    The latest version was not available as a binary for mac on git-scm.com, so I installed from source. I was missing a required package for localization, and added NO_GETTEXT=true to install without localization.

    git clone https://github.com/git/git.git
    cd git
    make NO_GETTEXT=true
    make NO_GETTEXT=true install
    

    This installed git under ~/bin which I then had to add to the beginning of my PATH variable.

提交回复
热议问题