世界が幸せで在ります様に

ITエンジニアになりたい人・エンジニアの人にとって役立ちそうな商品を紹介するブログ

gitを最新の2.19.0へアップグレードしよう

新しい機能が追加されたので、upgradeしよう。

 

blog.github.com

 

 

前提

  • Macユーザ
  • brew利用
  • brewですでにgit入っている

 

ここから手順

現在は2.18.0がインストールされている
$ git --version

git version 2.18.0

 

まずはbrewのパッケージを最新にする
$ brew update

Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
Updated 2 taps (heroku/brew, homebrew/core).
==> Updated Formulae
git ✔                              atomicparsley                      geoipupdate                        libphonenumber                     msgpack
heroku/brew/heroku ✔               bwfmetaedit                        grunt-cli                          lnav                               tor
heroku/brew/heroku-node ✔          double-conversion                  harfbuzz                           logentries                         upx
zsh ✔                              folly                              kubernetes-cli                     mariadb@10.1                       webpack
apache-drill                       fonttools                          kustomize                          media-info                         wskdeploy

無事にFormulaeにgitが入っていることが確認できた

 

念の為、バージョンも確認する
$ brew info git

git: stable 2.19.0 (bottled), HEAD
Distributed revision control system
https://git-scm.com
/usr/local/Cellar/git/2.18.0 (1,488 files, 35.2MB) *
  Poured from bottle on 2018-07-23 at 10:56:36
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/git.rb
==> Dependencies
Optional: pcre2 ✘, openssl ✔, curl ✘
==> Options
--with-curl
    Use Homebrew's version of cURL library
--with-openssl
  Build with Homebrew's OpenSSL instead of using CommonCrypto
--with-pcre2
    Build with pcre2 support
--HEAD
    Install HEAD version
==> 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

ちゃんと2.19.0が確認できたのでOK

 

ここまで確認できて初めてアプグレ
$ brew upgrade git --cleanup

==> Upgrading 1 outdated package, with result:
git 2.18.0 -> 2.19.0
==> Upgrading git
==> Downloading https://homebrew.bintray.com/bottles/git-2.19.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-2.19.0.high_sierra.bottle.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.19.0: 1,499 files, 309MB
Removing: /usr/local/Cellar/git/2.18.0... (1,488 files, 35.2MB)

 

ちゃんとインストールされたか確認する
$ git --version

git version 2.19.0

 

今後のgit

SHA1からSHA256にハッシュを使うように変更される計画