In Bash
$ git status > /dev/null; echo $?
0
Same repository in Powershell
$> (Start-Process git -ArgumentList="status" -Wait -PassThru).ExitCode
129
What is going on here, what 129
means and why it is not equal to 0
and how to get it right?
When you specify the arguments to git
incorrectly (and needs to print its usage) it will exit with error code 129:
C:\Temp>git status --asdf
error: unknown option `asdf`
usage: git status [options] [--] <filepattern>...
.... help is printed here ....
C:\Temp>echo %ERRORLEVEL%
129
Is it possible that you are passing the commands through PowerShell incorrectly? (Eg, is -Wait -Passthrough
being delivered to git-status
?)
You could avoid passing arguments entirely by calling the git-status
command instead of calling git
with the status
argument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With