git rebase --interactive がエラーをスローする

git rebase --interactive がエラーをスローする

私は Git をあまり使いません。誰か、git rebase --interactive正しく実行する方法を教えていただけませんか? 実行しようとするとエラーが発生します。

注記: 避けられない場合を除き、Xcode をアンインストールしたくありません (一部のパッケージではコンパイルに Xcode のツールが必要なため)。

エラーは次のとおりです:

$ git rebase -i /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-rebase--interactive: line 234: -w: command not found Could not execute editor

このファイルは当然存在し、実行可能なシェル スクリプトであり、--helpオプションはありません。

git version 1.9.3 (Apple Git-50)

答え1

問題は、git rebase -iどのエディタを使用するかが指示されなかったことです。したがって、エディタを設定することで解決します。

vim私たちの編集者は(またはnano、あるいはその他)であると主張しましょう。すると、

export GIT_EDITOR=vim(グローバル)

または

git config --global core.editor "vim"(地元)

問題は解決するでしょう。

クレジットグレン・ジャックマンへhttps://superuser.com/users/4714/glenn-jackman

関連する質問 https://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-commits

関連情報