The git start process returns a strange exit code 129

In bash

$ git status > /dev/null; echo $?
0

The same repository in Powershell

$> (Start-Process git -ArgumentList="status" -Wait -PassThru).ExitCode
129

What is happening here, what does it mean 129and why is it not equal 0and how to do it right?

+3
source share
1 answer

If you specify the arguments incorrectly git(and must print its use), 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 pass commands through PowerShell incorrectly? (For example, -Wait -Passthroughdelivered to git-status?)

You can completely exclude passing arguments by invoking the command git-statusinstead of invoking gitwith an argument status.

+5
source

All Articles