git rebase --interactive 拋出錯誤

git rebase --interactive 拋出錯誤

我對 git 比較陌生。請問有人可以幫忙git rebase --interactive正確運行嗎?當我嘗試執行它時它會拋出錯誤。

筆記:我不想卸載 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

這個檔案當然是存在的,是一個可執行的shell腳本,沒有--help選項。

git version 1.9.3 (Apple Git-50)

答案1

問題是我git rebase -i沒有被告知要使用什麼編輯器。因此,透過設定1來固定。

我們假設 out 編輯器是vim(或nano, 或 w/e)。然後要么

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

相關內容