【Mac】Gitバージョンアップ

2178 ワード

ほらを吹くことはありませんが、この文章は絶対に現在のネット上で最も簡単なGitアップグレードチュートリアルです.
取付HomebrewHomebrewはパッケージマネージャです.その役割は、パッケージを自分のディレクトリにインストールし、ファイルシンボルを/usr/localにリンクすることです.詳細については、自分で公式サイトにアクセスしてください.
次のコードを端末にコピーして、車に戻るをクリックして、おやつを開けて、食べながら待つといいです.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

アップグレードgit
  • インストール最新版のgit
    brew install git
    
    次の出力が表示されると、gitのインストールが完了したことを示します:
    Already downloaded: /Users/zhangpeng/Library/Caches/Homebrew/downloads/c5f94c257b885992f680bbe3c2b8ec009e8856aefebac2cc1fb6608d7f006152--git-2.20.1.mojave.bottle.2.tar.gz
    ==> Pouring git-2.20.1.mojave.bottle.2.tar.gz
    ==> Caveats
    Bash completion has been 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-lisp/git
    ==> Summary
    ?  /usr/local/Cellar/git/2.20.1: 1,528 files, 41.3MB
    
  • は、デフォルトのgitを変更し、端末内で私たちのgitの指向とバージョン情報を表示することを指します.
    ➜  ~ which git
    /usr/bin/git
    ➜  ~ git --version
    git version 2.17.2 (Apple Git-113)
    
    次に、brew linkを介してgitHomebrewによってインストールされたgit
    ➜  ~ brew link git --overwrite
    Warning: Already linked: /usr/local/Cellar/git/2.20.1
    To relink: brew unlink git && brew link git
    
    linkに指示し、端末を終了した後、再び開きます.次に、gitの指示およびバージョン情報を表示します.
    ➜  ~ which git
    /usr/local/bin/git
    ➜  ~ git --version
    git version 2.20.1
    
    では、gitバージョンが最新版にアップグレードされていることがわかります.

  • タイトル:【Mac】Gitバージョンアップ
    author: zhangpeng
    date: 2019.01.16
    GitHub: github.com/fullstack-z…
    転載先:https://juejin.im/post/5c3e9de86fb9a049b5071413