Without boasting, this article is definitely the simplest on the web right nowGitUpgrade tutorial

The installationHomebrew

Homebrew is a package manager. It installs the package into its own directory and symlinks its files to /usr/local. For more information, please go to the official website.

Copy the following code into the terminal, hit Enter, then open the snack, eat while waiting.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Copy the code

upgradegit

  1. Install the latest version of Git

    brew install git
    Copy the code

    Git is installed when you see the following output:

    Already downloaded: /Users/zhangpeng/Library/Caches/Homebrew/downloads/c5f94c257b885992f680bbe3c2b8ec009e8856aefebac2cc1fb6608d7f006152--git - 2.20.1. Mojave. Bottle. 2. The tar. Gz = = > Pouring git - 2.20.1. Mojave. Bottle. 2. The tar. Gz = = > Caveats Bash completion has had installed to: /usr/local/etc/bash_completion.d zsh completions and functions have been installed to: /usr/local/share/zsh/site-functions Emacs Lisp files have been installed to: / usr/local/share/emacs/site - the lisp/git = = > the Summary 🍺 / usr/local/Cellar/git / 2.20.1:1528 files, 41.3 MBCopy the code
  2. Change the default git pointing

    View our Git pointing and version information in the terminal.

    ➜  ~ which git
    /usr/bin/git
    ➜  ~ git --version
    git version 2.17.2 (Apple Git-113)
    Copy the code

    Next we point Git to the Git we installed through Homebrew via brew Link

    ➜ ~ the brew link git - overwrite Warning: Already linked: / usr/local/Cellar/git / 2.20.1 To relink: brew unlink git && brew link gitCopy the code

    Link is successful, exit the terminal, and open it again. Then check git pointing and version information.

    ➜  ~ which git
    /usr/local/bin/git
    ➜  ~ git --version
    git version 2.20.1
    Copy the code

    As you can see, our Git version has been upgraded to the latest version.


Title: [Mac] Upgrade Git version

author: zhangpeng

Date: 2019.01.16

Making: github.com/fullstack-z…