I am trying to clone a GitLab repo in a python script using GitPython. I want it to be able to clone this private repo from GitLab without me having to manually input my username and auth token each time I run the script.
I currently have:
from git import
Repo cloned_repo = Repo.clone_from("http://gitlab.com/reponame.git", "path/to/repo")
When I run this it runs the clone command which asks me for my username and password in the command line. I want to just pass that the username and pass to the command within the script or when I run it so this script can run without me interacting with it.
I tried passing the username and pass as parameters when running the program but they were not taken as input.
The solution could also be a python specific trick where I could pass env variables to the program so that when it asks for them it already has them, how could I give the GitPython command those environment variables so that it takes them as input?