Context: I have a node app with a mongo db attached to it. The db includes 2 structures, representing a file/folder system. Basically, have the tree structure representing the folders, and a contents structure representing the files.
The idea is to put this into GitHub using a js wrapper API for GitHub api (hopefully).
Question: I don't really get how GitHub API would accept this information.
- (a) When using the Git cli, I start with the
git init
, which sets up the git to begin with.
Where is this step? - (b) Looking here, a repo can be programmatically created. Awesome.
So, is the idea that files and folders (metaphorically) get pushed up into this repo now, without the need of thegit init
step? - (c) I get that what is getting pushed up are not files and folders, but rather commits. And that what is going up is content-addressable key pairs.
Can someone explain how this maps to a workflow that looks something like this:
- New project => create repo
- Setup some files and folders => push up changes
- Make some update => push up changes ...
The bit about how folders works is what is confusing me.
Any pointers would be most appreciated.