Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload a binary file using browser to github?

How do I upload a new binary file to Github?

I try to upload some woff fonts, but I cant, because Github allow me only to add a text file, and not how to upload one, even if there is this request that was solved.

like image 483
Abdelouahab Avatar asked Mar 14 '15 20:03

Abdelouahab


1 Answers

Since February 2016, you can add/create/upload new files from GitHub web interface.

You should not upload (big) binary files (they should be generated as part of a release, see second part of this answer).

But the feature (upload a file, any file) is there. See "Upload files to your repositories ":

You can click the “Upload files” button in the toolbar at the top of the file tree.

https://cloud.githubusercontent.com/assets/1369864/12961550/b9a688ea-d006-11e5-96d3-ac91097192a5.png

Or, you can drag and drop files from your desktop onto the file tree.

https://cloud.githubusercontent.com/assets/1369864/12961164/a888b59e-d004-11e5-80a6-e9f32f17c4d5.gif

This replaces the file creation described in the 2012 answer, and add the upload capability (for one or several files).


Original answer (March 2015)

The only part of the GitHub web interface which allows you to push a binary (or any other file you want) is when creating a release.
Then, there is a step where you can drag and drop any binary you need:

https://help.github.com/assets/images/help/releases/releases_adding_binary.gif

But for a regular repo, when creating new files, you can only edit a new file, not drag&drop an existing binary content:

https://help.github.com/assets/images/help/repository/new-file-content.png

So it isn't possible for now (March 2015)


like image 157
VonC Avatar answered Oct 24 '22 08:10

VonC