= Homebrewでこんな時には = Homebrewを使用していてトラブった時の対処メモです。 == gitのupgradeがうまくいかない == gitのダウンロード時にcouldn't connect hostとエラーを吐かれる場合 {{{ $ brew edit git }}} を叩いて、url部分の {{{ http://git-core.googlecode.com/files/git-1.8.x.x.tar.gz ↑ この部分を https://git-core.googlecode.com/files/git-1.8.x.x.tar.gz   ↑  としたらうまくいった }}} とりあえずurlの間違いを疑ってみること。 (httpとhttpsのどちらなのかはFormulaによって違うのか...?) == brew updateに失敗する == こんなエラーを吐かれた {{{ error: Your local changes to the following files would be overwritten by merge: Library/Formula/git.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 }}} 見たまま、読んだまま。 この前のbrew edit gitでの変更のせいかしらん? というわけで以下のようにして対処 {{{ $ cd /usr/local $ git stash $ git reset --hard }}} この後にbrew updateをしたら、うまくいった。 git stashは現在のワークツリーを一時的に保管(退避)するコマンド。 git resetは--hardでファイルの変更そのものをなかったコトにしている。 これでなんとか安全にファイルの書き戻しに成功。 その後も問題は特に発生していない。