I just came here looking for the same thing. It seems if you set the parameter search_parent_directories=True of git.Repo() you do not need to specify the root folder of the repo but can use any subdirectory, e.g. if you use os.path.dirname(os.path.realpath(__file__)) for some file deeper within the folder structure