Copy a set of files/trees from one repo to another repo via GitHub API?

Hi! Is there any way to copy a set of files/trees from one repo to another repo via GitHub API? Not by reading the content of the file from one repo and reupload to another repo, but some other ways e.g. through the tree SHA / blob SHA in the original repo? 

In theory, yes. In practice, you probably don’t want to shave that particular yak. Since there isn’t a magical “take this from here and put it there” API, you would still have to:

  1. Download all the appropriate blob data from the source repo
  2. Upload all the blob data to the destination repo by creating individual blob objects
  3. Create the recursive forest of tree objects necessary to reference all the blobs you just uploaded
  4. Then create a commit object to root the trees you just planted on the appropriate branch

Or, you could have Git do it because it knows how to manipulate its own database.