I am trying to clone a git repository hosted on Azure DevOps from within a notebook, using GitPython library. I generated a Personal Access Token with read/write access on git repositories.
The intent is to keep the git repository into the DBFS because it will be populated not only with notebooks sources but also outputs and MLFlow models.
In order to do so, I tried the following but keep facing error 128 from Git:
from git import Repo
git_url = 'https://<myPAT>@dev.azure.com/<org>/<project>/_git/<repo>'
repo = Repo.clone_from(git_url, '/git/')
Always resulting in the error, witout more details:
GitCommandError: Cmd('git') failed due to: exit code(128)
I checked from other places, my PAT is working perfectly.
I also tried to encode the PAT in Base64 and add the header 'Authorization : Basic <base64PAT>'
using the command below, but the result is the same.
encodedBytes= base64.urlsafe_b64encode(PAT.encode("utf-8"))
base64PAT= str(encodedBytes, "utf-8")
header = 'Authorization : Basic ' + base64PAT
git.Git().config_writer().set_value("http", "extraHeader", header).release()
Any hint on this ? Is GitPython relying on another config that I need to update or should I use another method ?