There is a way to turn your GitHub account into unlimited data storage.
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?
You may ask “what is the problem, Dan? Why you can’t just do git-pull-git-add-git-commit-git-push?” Thank you for the question. My answer is: I don’t want to git pull (download all files from repo) every time I want to upload a file. I really want this thing to be very tiny and lightweight.
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
TL;DR: one of the quickest and easiest ways to do this is to create and push a new branch for each new file.
First of all, create a new repository with a License file (or anything else) in the master branch. You can do this with a simple POST request using GitHub API:
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