-
Hello. I recently came across this library for git on Python. I am working on a project where client needs to have a script which he can run to fetch/pull all the changes from my git repository. The most important thing is that the computer will not have any SSH keys associated with gitlab therefore it will need to use username and password for authentication. I havent managed to find a way how to do this using GitPython. I can use the following script to commit and push to the repository:
The above script will work without any issues on the machine that has SSH keys for authentication. However, my other Raspberry PI device will not have SHH keys and I want to be able to authenticate using username and password.
and it will work fine without any issues. I was hoping to automate this process using GitPython. Any help is appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The tutorial contains an example for how to configure SSH connections. As for HTTPS, I'd expect such credentials to be stored and retrieved by URLs are allowed to contain username and password, and these could be used through GitPython as well. It's also possible to call credential managers by hand and store a user and password for a URL programmatically. The format is specified in the I hope that helps. |
Beta Was this translation helpful? Give feedback.
-
@Byron Could you provide any code examples? I assume something like that: (Notice I have full_url that includes my account username and password). How can I use this full url in GitPython?
|
Beta Was this translation helpful? Give feedback.
The tutorial contains an example for how to configure SSH connections. As for HTTPS, I'd expect such credentials to be stored and retrieved by
git
's built-in credential helpers.URLs are allowed to contain username and password, and these could be used through GitPython as well. It's also possible to call credential managers by hand and store a user and password for a URL programmatically. The format is specified in the
git
documentation - please be aware though that no tooling exists to make interacting with them easier, at least not in GitPython.I hope that helps.