私の現在の開発環境ではgit rebase
、インタラクティブ モード ( ) で実行すると、リベースの処理方法を伝える方法として、テキスト ファイルを変更するように求め--interactive
られることがよくあります。vi
vi は、git によって決定されたと思われる方法でこれらのファイルを強調表示します。(このコンテキストで git にとって特別な意味を持つ「pick」、「squash」などのキーワードは、異なる色で強調表示されます。)
私は vi よりも emacs を使用する方が好きなので、代わりに emacs を開くように git を構成しました ( git config --global core.editor "emacs -nw"
)。残念ながら、emacs は vi のように git によって提供されたファイルを強調表示しません。どうすればこれを修正できますか?
編集:
インタラクティブな git rebase によって生成されるファイルに慣れていない場合のために、以下に例を示します。
pick f218f23 A major overhaul of the cucumber integration tests
pick 601d8f4 A bunch of minor bug fixes and refactoring
pick 1adc507 Adding and updating documentation for various files.
# Rebase ff8cb22..1adc507 onto ff8cb22
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
c:\my_project\.git\rebase-merge\git-rebase-todo [unix] (15:50 26/10/2012)
この例では、キーワード「pick」、リビジョン ハッシュ、コミットの説明、およびコメントがすべて異なる色で強調表示されます。