2013-12-18 6 views
9

git add --patch somefile.txtをcygwinで使用すると、私は奇妙な反応を得ます。git add -patchを止める方法minttyでプロンプトを表示しない

最初にコマンドを入力すると、何も表示せずにと入力してと入力するのを待ちます。私はは、私は次の出力

--- a/somefile.txt 
+++ b/somefile.txt 
@@ -m,n +m,n @@ 
-Aple 
+Apple 
Bear 
Cat 
Dog 

Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? y - stage this hunk 
n - do not stage this hunk 
q - quit; do not stage this hunk nor any of the remaining ones 
a - stage this hunk and all later hunks in the file 
d - do not stage this hunk nor any of the later hunks in the file 
g - select a hunk to go to 
/- search for a hunk matching the given regex 
j - leave this hunk undecided, see next undecided hunk 
J - leave this hunk un 

を取得し、選択を行った後un

後カラットを残しを入力して押すと、この場合nに私は残り

J - leave this hunk unn 
decided, see next hunk 
k - leave this hunk undecided, see previous undecided hunk 
K - leave this hunk undecided, see previous hunk 
s - split the current hunk into smaller hunks 
e - manually edit the current hunk 
? - print help 
@@ -1,4 +1,4 @@ 
-Lne 1 
+Line 1 
Line 2 
Line 3 
Line 4 
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? @@ -289,6 +289,8 @@ 
Line 289 
Line 290 
Line 291 
+Line 292 
+Line 293 
Line 294 
Line 295 
Line 296 

パターンを取得しますファイルの残りの部分が続くので、私に何かメッセージが表示されているのかわからなくなってしまいます。

答えて

1

投票数を考えると、これは私がこの問題の唯一の人ではないように見えます。

Cygwinのデフォルトインストールにはgitが含まれていないようです。しかし、gitを個別にインストールした場合は、Windowsパスに追加され、他の点では動作するように見えます。私はCygwinの通過にgitをインストールし、問題が

すなわち

を解決した、そのバージョンを使用すると

すなわち

> which git 
c:\Program Files (x86)\Git\bin\git 

> which git 
/usr/bin/git 
これらの作品の
6

通常、Cygwinでgitを使用するときは2つの設定があります。

最初の1(あなたのgit config -lはすでにそれが含まれていない場合)ページャについてです(このgitconfig fileのように)

git config core.pager C:/cygwin/root/bin/less.exe 

[core] 
     # we want to use cygwin's less, because msys's doesn't play well 
     # with i/o via cygwin bash. This would be the default, but for the fact 
     # that msysgit prepends `dirname argv[0]` to $PATH. 
     pager = C:/cygwin/root/bin/less.exe 

他のthis blog postのように、TTYについて、次のとおりです。

export TERM=cygwin 
export LESS=FRSX 

これらの設定の1つは、git add -pをよりスムーズに実行する必要があります。

+0

ああのどれも、私が行うにはその何かを負うものではありませんInputとOutputStreamが使用されている方法 –

+0

私はこの賞金を唯一の回答であり、賞金の有効期限が近づいていたので、この賞金を授与しました。しかし、これらの設定は私のマシンに違いはありません。 –

関連する問題