Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

git.exc.InvalidGitRepositoryError #1112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mohoray opened this issue Jan 23, 2021 · 2 comments
Open

git.exc.InvalidGitRepositoryError #1112

mohoray opened this issue Jan 23, 2021 · 2 comments

Comments

@mohoray
Copy link

mohoray commented Jan 23, 2021

Following is the snippet of the code I am using.

import git
repo = git.Repo(search_parent_directories=True)
branch = repo.active_branch

After running the code, I have received the following error.

File "/home/user_name/.local/lib/python3.8/site-packages/git/repo/base.py", line 181, in __init__
    raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: /home/user_name/.local/lib/python3.8/site-packages/git/repo

It will be really great if I get some suggestions about solving this error. I am using gitpython version 3.1.12.

Thanks a lot.

@Byron
Copy link
Member

Byron commented Jan 23, 2021

Does the path at 'current working directory' actually contain a repository? Here is what GitPython does to figure out if there is a git directory.

Without further information there is not much that can be done here.

@mohoray
Copy link
Author

mohoray commented Jan 23, 2021

I will check that. Thank you

@Byron Byron closed this as completed Feb 26, 2021
@gitpython-developers gitpython-developers locked and limited conversation to collaborators Feb 26, 2021
@Byron Byron reopened this Feb 26, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Development

No branches or pull requests

2 participants