2012-12-16 34 views
2

我見過有關使用記事本++和其他編輯器的git,但沒有關於使用PN2的文章。使用程序員的記事本2作爲編輯git

我試過放在下面的變化,但他們都不似乎工作:

git config --global core.editor "'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w" 

我只是得到這樣的錯誤以下(這是後「git的承諾--amend」):

'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w: -c: line 0: 
unexpected EOF while looking for matching `'' 
'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w: -c: line 1: 
syntax error: unexpected end of file 
error: There was a problem with the editor ''C:\Program Files (x86)\Programmer's 
Notepad\pn.exe -allowmulti' -w'. 
Please supply the message using either -m or -F option. 

是否有可能得到這個工作?

+0

**你想使用PN2的是什麼**?一般來說,git不需要編輯器,也不需要關心你用它做什麼,所以你需要解釋的是:你想用什麼來使用PN2,**完全**;你在哪裏使用了上述命令(cmd,powershall,bash)? –

+2

我只是使用windows命令行來執行命令。我想使用pn2來輸入提交消息和交互式rebase。使用控制檯的默認git編輯器似乎打破了控制檯。我嘗試改變爲簡單的記事本(這是mercurial用於提交消息窗口的東西),但是這不適用於交互式變形,因爲它會使行結束。 – user673679

+0

不知何故錯過了實際的git命令。我編輯它。: -/ – user673679

回答

5

編輯器由git使用bash腳本啓動。所以你應該確保你的引用是針對bash shell的。您使用了單引號,但是您在目錄名稱中包含單引號。您應該也可以使用正斜槓並使其變得unixy。有關使用Notepad ++的示例,請參見this answer。在你的情況下,我認爲以下應該是好的:

git config --global core.editor "\"C:/Program Files (x86)/Programmer's Notepad/pn.exe\" -allowmulti -w" 
+2

請注意,最新版本的Programmer記事本需要兩個破折號allowmulti;例如--allowmulti –

相關問題