2 years ago

#24565

test-img

intrigued_66

GitPython Read a branch without it existing locally or cloning

I'm trying to read a branch from a Git repository without having a local copy or cloning the repo.

The GitPython API seems to assume a repo either exists locally or you with to clone it to read it.

All i'd like to do is access all the commits from a branch, for a repo, without it existing locally.

I'm after something like this:

    branch = git.Repo(https://github.com/MyOrg/MyRepo, 'master')

    for commit in branch.commits:
        print(commit)

I'm looking at the API and I just don't see anything like this.

Is this possible?

python

git

gitpython

0 Answers

Your Answer

Accepted video resources