[Git] brew update (git pull) するとエディタが起動してコミットメッセージを求められるを止める
memo.
brew update が都度止まってしまうので不便だなと思い調べました。
[markdown]
## 原因
自分の環境では、以前に加えた merge の設定変更に起因するよう。
> * [Gitflow でブランチを華麗にさばきたいを SourceTree で実現する | deadwood](https://www.d-wood.com/blog/2015/04/07_7459.html)
以下で、merge のデフォルトの振る舞いを –no-ff としていた。
“`prettyprinted
% git config –global merge.ff false
“`
~/.gitconfig にこんな設定が加わっている。
“`:~/.gitconfig
[merge]
ff = false
“`
## 対策
対策としては3つくらい。
どう対処するか、下記を確認しつつ考える。
### 実行時に指定する
`brew update` 実行を以下のように行う。
> * [brew update – opens vi, asks for a commit msg · Issue #11673 · Homebrew/homebrew](https://github.com/Homebrew/homebrew/issues/11673)
“`prettyprinted
$ GIT_MERGE_AUTOEDIT=no brew update
or
$ export GIT_MERGE_AUTOEDIT=no
$ brew update
“`
### シェルの設定に加える
`git merge` 時にエディタが起動しないように設定する。
> * [git – GIT_MERGE_AUTOEDIT=no by default – Stack Overflow](http://stackoverflow.com/questions/13748344/git-merge-autoedit-no-by-default)
~/.bash_profile あたりに下記を追記する。
“`:~/.bash_profile
export GIT_MERGE_AUTOEDIT=no
“`
### git の設定に加える
`git merge` 時にエディタが起動しないように設定する。
> * [Git – merge-options Documentation](http://git-scm.com/docs/merge-options)
> * [Git merge doesn’t use default merge message, opens editor with default message – Stack Overflow](http://stackoverflow.com/questions/12752288/git-merge-doesnt-use-default-merge-message-opens-editor-with-default-message)
下記を実行。
“`prettyprinted
% git config –global core.mergeoptions –no-edit
“`
~/.gitconfig に以下の設定が追記される。
“`:~/.gitconfig
[core]
mergeoptions = –no-edit
“`
## 補遺
> * [ヾ(o゚ω゚o)ノ゙brew updateでエラーでたった[Homebrew] – Qiita](http://qiita.com/harapeko_wktk/items/f4f44ddb5d3912e15ea2)
[/markdown]