def _gitPresent():
 try:
  gitvers = subprocess.check_output('git --version'.split(), stderr=subprocess.PIPE)
 except (CalledProcessError, OSError):
  gitvers = ''
 return bool(gitvers.startswith('git version'))

def _gitPresent ( ) : try : gitvers = subprocess . check_output ( 'git --version' . split ( ) , stderr = subprocess . PIPE ) except ( CalledProcessError , OSError ) : gitvers = '' return bool ( gitvers . startswith ( 'git version' ) )
check for git on command-line .