Skip to content

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

Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants