Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git "InvalidGitRepositoryError"

I am supposed to analyze the results of a paper, here is the link for the provided code https://github.com/xiat0616/pseudo-healthy-synthesis

In the file run.py, I am facing the following error:

Traceback (most recent call last):
  File "pseudo-healthy-synthesis/run.py", line 76, in <module>
    exper = experiment(comet_exp)
  File "pseudo-healthy-synthesis/run.py", line 17, in __init__
    self.repo = git.Repo(search_parent_directories=True)
  File "/usr/local/lib/python3.6/dist-packages/git/repo/base.py", line 181, in __init__
    raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: /content 

The error is generated from this instruction

git.Repo(search_parent_directories=True)

This is my first time working with Git in python and I don't know how to solve this problem. (I am using gitpython-3.1.13)

like image 213
Wassim Bouatay Avatar asked Mar 29 '26 00:03

Wassim Bouatay


1 Answers

You need to add a path to a git repository to the git.Repo function:

git.Repo(repo, search_parent_directories=True)
like image 176
Daniel Avatar answered Apr 01 '26 09:04

Daniel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!