code: def is_git_repo():
      
      cmd = "git", "rev-parse", "--git-dir"
      try:
          subprocess.run(cmd, stdout=subprocess.DEVNULL, check=True)
          return True
      except subprocess.CalledProcessError:
          return False
docs: Check whether the current folder is a Git repo.