如果在PowerShell中v3的試試這個:
$out = git log ORIG_HEAD --% --no-merges --date=short --pretty="format:<tr><td>%h</td><td>%ad</td><td>%an</td><td>%s</td></tr>"
$out > test.txt
的 - 放在%的PowerShell成不同的解析模式更適合本地的可執行文件。有關更多詳細信息,請參閱此blog post。
如果你還沒有使用PowerShell v3的,我建議你使用從PowerShell Community Extensions echoargs看到論據git.exe從PowerShell中接收它們如:
PS> echoargs log ORIG_HEAD --no-merges --date=short --pretty="format:<tr><td>%h</td><td>%ad</td><td>%an</td><td>%s</td></tr>"
Arg 0 is <log>
Arg 1 is <ORIG_HEAD>
Arg 2 is <--no-merges>
Arg 3 is <--date=short>
Arg 4 is <--pretty=format:<tr><td>%h</td><td>%ad</td><td>%an</td><td>%s</td></tr>>
Command line:
"C:\Program Files (x86)\PowerShell Community Extensions\Pscx3\Pscx\Apps\EchoArgs.exe" log ORIG_HEAD --no-merges --date=short --pretty=format:<tr><td>%h</td><td>%ad</td><td>%an</td><td>%s</td></tr>
如果你能看到PowerShell是如何傳遞對於exe的爭論,你有一個戰鬥機會來弄清楚如何按摩通常涉及使用額外引號的爭論。
對不起,這是powershell 2 – Justin808