Git status exit status ?
March 14th, 2008
1 2 3 4 5 |
$ git status # On branch master nothing to commit (working directory clean) $ echo $? 1 |
Shouldn’t a successful git status in a git repository return a status code of 0 ? Doing it in a random folder returns a sensible value:
1 2 3 4 5 |
$ git status fatal: Not a git repository Failed to find a valid git directory. $ echo $? 128 |
Can anybody shed some light on this ?
I found Possible bug in ‘git status’ exit code is 1 instead of 0. What is the rational for this ? It goes against everything Unix ?!?
Leave a Reply