This fine morning we were facing this error unknown option 'ahead-behind' while running this git command from an internal script.

git status -sb --ahead-behind

Problem

Well, it was a new machine and we found out that the device has old version of git which simply doesn't support this feature.

error: unknown option 'ahead-behind'
usage: git status [<options>] [--] <pathspec>...

Solution

We just had to update the git version.

For mac OSX we run the below commands, but for windows or linux you can simply download or update your git with respective command.

Mac Solution:

$ brew install git
$ brew link --overwrite git