code: def run(self, cmd):
          
          cmd = ['git', '--git-dir=%s' % self.path] + cmd
          print("cmd list", cmd)
          print("cmd", ' '.join(cmd))
          res = None
          try:
              res = subprocess.check_output(cmd)
          except BaseException:
              pass
          if res:
              try:
                  res = res.decode()
              except UnicodeDecodeError:
                  res = res.decode('utf-8')
          return res
docs: Execute git command in bash