How do we get this command to run on Powershell with out error : The '<' operator is reserved for future use.
C:\Users\Me\my-git-repo > git am < MyFix.patch
The '<' operator is reserved for future use.
At line:1 char:9
+ git am < <<<< MyFix.patch
+ CategoryInfo : ParserError: (<:OperatorToken) [],..
+ FullyQualifiedErrorId : RedirectionNotSupported
Derek Redfern
Use either:
Get-Content MyFix.patch | git am
or:
cmd /c 'git am < MyFix.patch'
Both should work equally well. Windows Powershell simply doesn't support IO redirection with < for now, so you either need to pipe the text to stdin using | (Get-Content[1] sends the contents of MyFix.patch to stdout and | feeds it along to git am's stdin); alternatively, run the command through CMD.exe.
[1] Alternatively, use the built-in alias type.
来源:https://stackoverflow.com/questions/24527941/git-am-myfix-patch-command-error-in-powershell