How to put disk size quota on a git repository?
I’m using Git as a data storage system, there are multiple users in system and everyone of them has its own git repository.
Is it possible to quota disk usage for Git repository (quota should work on pull-requests, not push-request, server initiates pull-request to pull data from some remote user repository)? A rule like “The
/my-app/storage/user-x-repository should be less than 100Mb”? I need it to prevent one user to take extra disk space.
It is possible to use unix disk quotas per unix-user, but it seems there’s no way to set disk quotas per folder.
If user reaches its quota – his repository should fail in any way, it’s not important, the important part – “bad user” shouldn’t be allowed to harm other users by taking extra space.
Is there any way?
One Solution collect form web for “How to put disk size quota on a git repository?”
Really depends on the OS you are using…
If linux then you could
1) Use dd to create an image file of a set size
2) Create a File System in the image
3) mount the image to /my-app/storage/user-x-repository
4) put a mount command in /etc/mtab to make sure this is mounted on reboot
Windows you would need to find an image mounting tool ..