Image for post
Image for post

Microsoft will pay for your unlimited cloud storage

There is a way to turn your GitHub account into unlimited data storage.

unlimited stoooraaaage (GIF from GIPHY)

According to GitHub, we can create an unlimited amount of public and private repositories. We can store up to 1 Gb in one repo and each file should be 100 Mb maximum. That smells like an opportunity to create free unlimited cloud storage, right?

I understand that any modern cloud storages like Dropbox, Google Drive or event Amazon S3 are very very cheap and reliable. But this GitHub-based solution can be really useful if you need to quickly upload a file that will have a public download link or you are building a small project (e.g. for hackathon) and you need a way to store files somewhere without any heavy dependencies and debugging.

How to upload a file to a GitHub repository?

Image for post
Image for post
The button without API

There would be no problem if this magic “Upload files” button had the corresponding API. Unfortunately not.

And I’ve found several ways to do that. Here is the simplest one.

Upload a file to GitHub


Secondly, create a new branch for each file you’d like to upload. You’d probably also like to decrease the number of collisions while uploading the files with the same name but with different content, so choose branch name wisely: I’d recommend you to use file hash and maybe a Unix timestamp.

Finally, push this branch to GitHub:

if git push --set-upstream origin $BRANCHNAME

After that, you can delete all local branch files to save disk space:

git checkout master
git branch -D $BRANCHNAME

I’ve implemented the bash-script that does all this upload-to-GitHub stuff, you can check it here.

Is there any tool that creates this free unlimited cloud?

Step-by-step installation guide for you guys

Image for post
Image for post

Written by

Daniil Okhlopkov

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store