Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub v3 API: How to create initial commit for my shiny new repository?

GitHub API docs says:

Git DB API functions will return a 409 if the git repo for a Repository is empty or unavailable.

My POST on $repo/git/trees returns 409 indeed.

How do I create initial commit in the repository then? Do I have to force user to commit some useless junk manually, just for the sake of creating root commit?

like image 406
Almad Avatar asked Mar 12 '12 16:03

Almad


1 Answers

I emailed github support with the same issue and here is their response:

From: Rick (GitHub Staff)
Subject: Creating an initial commit using the v3 API

Currently, you can't add the initial commit through the API.  Thanks for the
feedback. I've added your suggestion to the Feature Request List™ for the team
to see.

As a workaround, depending on your use case, you may be able to create forks rather than new repos.

like image 113
Daniel X Moore Avatar answered Sep 23 '22 03:09

Daniel X Moore