LoginSignup
30
29

More than 5 years have passed since last update.

なんかやばいらしいのでgitのバージョン上げる

Last updated at Posted at 2014-12-19

https://github.com/blog/1938-vulnerability-announced-update-your-git-clients
やばいらしいのでバージョン上げる

ちょっと詰まったのでメモ
せっかくなのでhomebrewで上げる

まずアップデート

$ brew update
error: Your local changes to the following files would be overwritten by merge:
    Library/Formula/go.rb
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

こけた

$ cd /usr/local/Library/Formula
$ git reset --hard FETCH_HEAD
$ brew update

これでOK

$ brew upgrade git
==> Upgrading 1 outdated package, with result:
git 2.2.1
==> Upgrading git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.2.1.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-2.2.1.mavericks.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
  /usr/local/bin/git-credential-osxkeychain

The "contrib" directory has been installed to:
  /usr/local/share/git-core/contrib

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
  /usr/local/Cellar/git/2.2.1: 1356 files, 31M

OK

$ git --version
git version 1.9.3 (Apple Git-50)

パスがbrewの方をみてない
/etc/pathsをいじってbrewでインストールした方を優先させるようにする
/usr/local/binを一番上に持ってくる

$ cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

ターミナル再起動して確認

$ git --version
git version 2.2.1

OK

30
29
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
30
29