from github import Github
access_token = "MYACCESS_TOKEN"
g=Github(access_token, retry=20)
repo = g.get_repo("pygit/git")
print(repo.name)
branches = repo.get_branches()
for branch in branches:
print(branch.name)
for file in repo.get_contents(""):
print(file.name)
Here I can list the branches. [I have 5 branches] I can list all the branches and I am able to view the content present in the root level of the repository.
But I am not able to select particular branch. where my data is present inside a subfolder of particular branch.
Expecting:
- List all branches in a repository [Done]
- Move inside a particular branch.
- List all the contents inside a branch including directories.
- Move inside a directory.
- List all the content present in that directory.