LoginSignup
12
12

More than 5 years have passed since last update.

OS X 10.10 Yosemiteにアップグレードした後でgit-pullが"git-sh-setup: No such file or directory"を吐く。

Last updated at Posted at 2014-10-18

今回OS X 10.10 Yosemiteにアップグレードした後でvim(NeoBundle)を使うと
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-pull: line 11: git-sh-setup: No such file or directory
のエラーを吐いて、その対処に四苦八苦したので自分用の備忘録として。

なお、こちらのコメントにてiTerm2のバージョンアップでこの問題が回避できることが分かりました。(自分の環境でも動作確認済みです)
報告をしてくださった@xibbarさん、本当にありがとうございました。

環境

Mac OS X 10.10 Yosemite
git version 1.9.5 (Apple Git-50)
Xcode 6.1
MacVim 7.4

エラー

Vim起動後に:NeoBundleUpdateを実行すると
[neobundle/install] Update started: (2014/10/17 21:03:06)
/Users/(User名)/.vim/bundle/unite.vim
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-pull: line 11: git-sh-setup: No such file or directory

のメッセージが発生。

対応策

今回この問題に対処するついでにMacデフォルトのgitではなく、Homebrewのgitに移行した。
その方法についてはこちらで紹介されているので割愛する。

今回の対処については以下のページを参考にした。
http://stackoverflow.com/a/24023702

  1. git-pullの11,12,229,329,336行目をそれぞれ
git-pull
. /usr/local/Cellar/git/2.1.2/libexec/git-core/git-sh-setup
. /usr/local/Cellar/git/2.1.2/libexec/git-core/git-sh-i18n
. /usr/local/Cellar/git/2.1.2/libexec/git-core/git-parse-remote
eval="/usr/local/Cellar/git/2.1.2/libexec/git-core/git-rebase $diffstat $strategy_args $merge_args $rebase_args $verbosity"
eval="/usr/local/Cellar/git/2.1.2/libexec/git-core/git-merge $diffstat $no_commit $verify_signatures $edit $squash $no_ff $ff_only"

に変更
2. git-rebaseの47,48行目をそれぞれ

git-rebase
. /usr/local/Cellar/git/2.1.2/libexec/git-core/git-sh-setup
. /usr/local/Cellar/git/2.1.2/libexec/git-core/git-sh-i18n

に変更で完了。

もしMacデフォルトのgitで対処したい方は、git-pull,git-rebaseそれぞれパス指定を
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/
に変更すれば良い。
ただし、変更する行数が若干ずれている。

追記1(2014/10/21)

もしかしたら、同一ディレクトリにあるファイルなのでパス指定を

git-pull
. ./git-sh-setup

にしてもいけるのではと思ったが、ダメだった。

追記3(2014/10/25)

前回の追記2(2014/10/25)でgit-pullの336行目がパス指定を間違えていると書いたが、本文対応策1.で書いたパスがそもそも間違えていたのが原因だった。

現在は本文の当該箇所を修正したものを記述している。
合わせて、紛らわしいので前回の追記2は削除した。

12
12
4

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
12
12