(Note this is using github's v3 API. They have a new v4 version that uses graphql. Haven't tried that at the time of writing.)
Using github API is a bit weird at first, because uses the same lower-level git commands that are abstracted away to the normal user. However, this is actually a good thing to some degree, because it means you can do things like changing a single file without copying out an entire branch or repo to your disk.
I will be referencing git objects (blobs, trees, refs, etc.) in this short tutorial, but not covering them in gory detail. You can learn more about them here.