How do i upload a folder that contains all my code files to my Github repo using Github's REST API programmatically? #83252
-
Select Topic AreaQuestion BodyHow do I upload a folder that contains all my code files to my Github repo using Github's REST API programmatically? Can anyone help me do that in JavaScript with Node.js? Currently, when I try to run my code, it only uploads files, but how do I upload a folder instead? I don't want to upload files one by one. Any idea what to do?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 13 replies
-
Probably you have to loop through all files in the folder and upload them one by one. |
Beta Was this translation helpful? Give feedback.
-
@DozenLimeStone I did this but then it created a myfoldername.zip file in my GitHub repo with a base64 string like "YW1vZ3VzLmh0bWw=" instead of my code files my code:
|
Beta Was this translation helpful? Give feedback.
-
this is not actually answered; following from isaacs/github#199 to here how can do Multi file operations in a single commit through the contents API. #199 ? |
Beta Was this translation helpful? Give feedback.
@xts-bit Well then recursively get them all :) The best other thing you can do is to compress them into one file and send it.