Fix Git install check

Since `which` output result to stderr when the target command is not found,
we should check error message in stderr instead of stdout.