I have a NodeJS server which is generating a server-side JS code into a separate folder on the server and then serves it to the user as a .zip file. I would like to be able to take this code and push it to a GitHub repository the user would specify (or even better- create a new brunch and push it to the branch). I was checking GitHub API but I could not find an endpoint, which would describe this situation. I also checked one node module, but the same story- no information about if this is possible (and how) or not.
My question is- Is it possible to take a folder on a server and push it to a GitHub repo (if all the credentials and keys are known) programatically and if so, can anyone please direct me to some resources? I tried to find something but nothing was relevant.
Thank you, T.
I've just found these two libraries, that can help you to push your files to git from Node.js:
git
binaryJust use the provided API programmatically to commit and push files. You could create a separate branch if you want and tag your commits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With