Question

[[Please note that Github has changed a lot since this question was first asked; instead of "download page" read "new release".]]

I generate PDF documentation as part of my projects and I'd like them to stay in sync with my Git repository (it's not always possible for people to build their own since they often use proprietary fonts).

However, it's not really "correct" to add the PDFs to the repository since it's a derived file; furthermore, doing this adds significantly to the size of the commits and the size of the repository overall.

Is it possible to programmatically send files to the GitHub download page? (I know that tagged commits are automatically added there with git push --tags but I don't know where this is documented. I suppose I could do something fancy by adding a separate branch only containing the PDFs themselves — as done by the GitHub user pages — but I'm a bit rusty on using Git this way.)

Was it helpful?

Solution

Github API v3 supports this feature.

GitHub also provides a maven plugin based on the java API that is part of the Eclipse Mylyn connector for GitHub.

There is a ruby gem called github_api.

The other answer talks about net-github-upload which is available for perl and ruby.

OTHER TIPS

check out for net-github-upload which is available

for perl: http://github.com/typester/net-github-upload-perl and ruby: http://github.com/Constellation/ruby-net-github-upload

With that you can write a small script to upload and update your PDF easily. To sad there's no easy way provided by github guys themselves..

cheer!

The GitHub blog post announcing that this feature has been disabled: https://github.com/blog/1302-goodbye-uploads

I take it that by "GitHub download page", the owner means a repo–more specifically a branch– that can be downloaded via the "download" button.

If you want to add a file to a repo using the API, you will have to become familiar with the process described here: https://developer.github.com/v3/git/

It's not the easiest process in the world, but mastering it will force you to understand the concepts of blobs, trees, commits and references, amongst others.

You can't just "send a file" to a repo because you're working with Git, and Git has some "internal expectations" that you just can't ignore (it's impossible to think of GitHub as some sort of host that you can ftp). Explaining the flow required to create a file in a GitHub repo is certainly beyond the scope of the original question, but to provide a clear answer: no, it's not possible to programmatically upload a file on GitHub, but yes it is possible to programmatically push a file on GitHub".

There's a PHP library named GitHubTreePHP that lets you automate the process (Disclaimer: I wrote it).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top