code: def __run_git(cmd, path=None):
      
      exe = [__get_git_bin()] + cmd
      try:
          proc = subprocess.Popen(exe, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      except subprocess.CalledProcessError:
          return None, None
      except ValueError:
          return None, None
      except OSError:
          return None, None
  
      out, err = proc.communicate()
      if IS_PYTHON3:
          out = out.decode("utf-8")
      if err:
          print("Cmd ('%s') fails: %s" % (' '.join(exe), err))
          return None, proc.returncode
      return out.strip(), proc.returncode
docs: internal run git command
      :param cmd: git parameters as array
      :param path: path where command will be executed
      :return: tuple (<line>, <returncode>)