trilbymedia / grav-plugin-git-sync

Collaboratively Synchronize your Grav `user` folder hosted on GitHub, BitBucket or GitLab
Apache License 2.0
240 stars 58 forks source link

Can't handle big files in pages folder #182

Closed ZweiEuro closed 3 years ago

ZweiEuro commented 3 years ago

I have big files in my pages, i can't gitignore them since that file gets overwritten automatically, causing git sync to try to push them to github, which refuses the size. The compression slows down the server to almost a full halt. Making it also hard to handle. The files in question are a few 150MB + .zip files.

Is there no way to exclude these kinds of things? I also tried setting everything up on github and on the server before activating the plugin, but it instantly overwrites .gitignore and adds all files (which includes the .zip) starting my issue all over again. pretty much swamping my repo with files that are either not supposed to be there or too large to get there, making them hang out in the git track history which is also not wanted

w00fz commented 3 years ago

GitHub has a strict limit of 100MB file size, anything bigger won't allow you to push the commit. The way around it is to either enable LFS (Large File Storage) or to add to the gitignore the files you dont want to be tracked, AFTER you enabled the plugin so it doesnt override any gitignore. You will want the .gitignore to be in the user/ folder.

All of this unfortunately has nothing to do with GitSync per se, it is purely the way you deal with git repositories. GitSync only understands diff changes, commits, pull and push.

This is a good article that explains the above in better details as well as offering possible solutions: https://towardsdatascience.com/uploading-large-files-to-github-dbef518fa1a