2017-11-19 12 views
1

WindowsビルドエージェントにGit Bashがインストールされていて、スクリプトを実行しているときに「find」を使用するたびにUnixの代わりにDOS Find(https://technet.microsoft.com/en-us/library/bb490906.aspx)が実行されます。私のスクリプトがfind.exeを拾うのにC:\ Program Files \ Git \ usr \ binと言ってもいいですか?WindowsでGit-Bashバイナリの優先順位を設定する方法

λ find /? 
Searches for a text string in a file or files. 

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]] 

私は

λ "c:\Program Files\Git\usr\bin\find.exe" --help 
Usage: /usr/bin/find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression] 

感謝を見つけることがUnixのスタイルをピックアップするためのコマンドを実行するときに、明示的にパスを述べるか、binディレクトリにあることがあります!

答えて

0

私は通常、単純化さPATH使用:

set G=c:\path\to\latest\git 
set PATH=%G%\bin;%G%\usr\bin;%G%\mingw64\bin 
set PATH=%PATH%;C:\windows\system32;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\ 

GH(Gitのインストールフォルダ)がWindows\System32を設定されている場合は、Gitリポジトリからの検索は、デフォルトのWindows 1の上に選択されます。

where findと入力すると、そのコマンドがどこにあるかを確認できます。

関連する問題