I have written a simple NodeJS HTTPS listener to receive a POST with an authentication token, and git credentials. This will be run when a Web Hook hits the end-point URL after code is returned to the repository.
What I'd like to do is take those credentials and run a git pull on a repository that is on that host utilizing those credentials (and then kick off some other stuff, which is out of the scope of this question).
Ideally, I'd love to:
- Run a command to store the username and password into the git credential manager
- Run a git pull which will utilize those credentials.
- Erase the credentials from the git credential manager
I will be doing all of this via NodeJS, but I think that should mostly be irrelevant for my question. If I know a command-line way to set / clear credentials I should be in good shape.
Can anyone point me in the right direction? I've been having a really hard time deciphering the git help documentation on this. Everything mentions typing in the credentials from a person, and then having them still there later for the script to use. Our security group will not let us do that.
As a result we need the credentials entered, and later cleared, from a script.