GitPython

Table of Contents

Get the root(toplevel) of the git repository howto

from git import Repo

repo = Repo('.', search_parent_directories=True)
print(repo.working_tree_dir)
/Users/yeonghoey/yeonghoey