I have a batch file where I want to use the command git pull
Sometimes the git command might fail from different reasons (The one that I discovered was that it had modified files)
However using the %ERRORLEVEL% or !ERRORLEVEL! do not work at all
git pull
IF %ERRORLEVEL% NEQ 0 (
ECHO restoring source code returned %ERRORLEVEL%
EXIT /B 1
GOTO:EOF
)
How can I determine that the command git pull has failed?