2012-11-26 52 views
8

私はいくつか示唆したことを試しましたが、何もそれを削除するようです。これは、私がMountain Lion OS Xにアップグレードしたときに始まりました。いつでもgit pullを実行すると、これは、この厄介な空のエディタをMERGE_MSGというタイトルで表示します。gitのMERGE_MSGを削除するにはどうすればよいですか?

は全世界でのポップアップを防ぐ方法を教えてください。

+1

あなたに迷惑をかけるほど頻繁に起こっているのであれば、それはあまりにも多くのマージをして醜い歴史を起こすという兆候でしょう。 – qqx

+1

他の開発者と仕事を共有している場合はどうすればよいですか?それは避けられないだろうか? – Trip

+0

ここで意図した動作は、エディタを開いてユーザーにメッセージを入力させることです。しかし、これはnanoなどでしか動作しません。崇高なプロセス**がすぐに終了します**気晴らしが既に開いている場合(私はいつも開いています) – xjcl

答えて

13

--no-editgit pullのいずれかを渡すことも、環境変数GIT_MERGE_AUTOEDITnoに設定することもできます。 git pullドキュメントから

:ローカルへのリモートブランチの

--edit, --no-edit 
     Invoke an editor before committing successful mechanical merge to 
     further edit the auto-generated merge message, so that the user can 
     explain and justify the merge. The --no-edit option can be used to 
     accept the auto-generated message (this is generally discouraged). 
     The --edit option is still useful if you are giving a draft message 
     with the -m option from the command line and want to edit it in the 
     editor. 

     Older scripts may depend on the historical behaviour of not 
     allowing the user to edit the merge log message. They will see an 
     editor opened when they run git merge. To make it easier to adjust 
     such scripts to the updated behaviour, the environment variable 
     GIT_MERGE_AUTOEDIT can be set to no at the beginning of them. 
0

マージはその後引っ張ってより詳細に制御できます。マージは「早送り」(マージ・メッセージは不要)であり、マージ・メッセージは意味があります。プルはあなたに「早送り」オプションを与えず、常に推奨されないデフォルトのマージメッセージを生成します。

0

git pullは、git fetchであり、それに続くgit mergeである。 - マージ:マージコミットが発生した場合、そのメッセージを要求します。

マージの代わりにgit rebaseを実行することを提案します。履歴を線形に保つのに役立ち、追加のマージコミットを回避できます。 git pull --rebaseはこれを1度に実行します(つまり、git fetchに続いてgit rebase)。

関連する問題