To run the script properly, just create a creds.py file with a token variable, and a .tmp folder
importcredsfromgitimportRepo, RemoteProgressfrompathlibimportPathimportuuidusername="gitpython-developers"repo_name="GitPython"uuid=uuid.uuid4().hex[:20]
# ---------------classProgress(RemoteProgress):
defupdate(self, op_code, cur_count, max_count=None, message=''):
print(f"{op_code}{cur_count}{max_count}{message}")
repo_url=f'https://{creds.token}:x-oauth-basic@github.com/{username}/{repo_name}'repo_path=Path('.tmp') /Path(uuid)
print(f'Cloning the commits history of {repo_name}...')
err=Nonetry:
Repo.clone_from("https://github.com/gitpython-developers/GitPython", repo_path, progress=Progress(), multi_options=["--filter=tree:0"])
#Repo.clone_from(repo_url, repo_path, progress=Progress(), multi_options=["--filter=tree:0"])exceptExceptionaserror:
err=errorprint(err)If you comment the 1st Repo.clone_from and uncomment the 2nd, the progress will not work anymore, even though the progress is showing up using the git binary.
To run the script properly, just create a creds.py file with a token variable, and a .tmp folder
If you comment the 1st Repo.clone_from and uncomment the 2nd, the progress will not work anymore, even though the progress is showing up using the git binary.