How to get the directory git detail from repo in GitPython?

Refresh

4 weeks ago

Views

4 time

0

I would like to get the number of commit of a directory(called module) from a repo(project) in GitPython.

> print("before",modulePath) 
> repo = Repo(modulePath)                    
> print(len(list(repo.iter_commits())))

When I'm trying to print the directory amount of commits, It says the repo is not a valid git Repo.

  • before /home/user/project/module
  • git.exc.InvalidGitRepositoryError: /home/user/project/module

Any help or idea would be welcome :) Thanks

0 answers