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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With