Search code examples
gitdrupal-7

Where to put big files if not in repo?


We use Drupal for a lot of our development, and we often include the /sites folder when committing it to the repo. But this isn't really possible for seriously big sites. I mean, you can't save a 1GB video file in your GitHub repo. We are hitting the limit on images mostly. Repos are getting very big because of all the content being uploaded and being stored in /sites/.

If I do not include these files in the repos, then developers can't see the pages properly, as content will be missing. If I link directly to the server, it will be slower to get content and not work 100% offline.

So what is the best way to deal with keeping your big media files in a repo? Is there a way to somehow "offload" parts? Or should you perhaps keep two repos, one for the user content and one for the code?

Any tips on how to get around this git problem will be great! I want to avoid increasing the size of my repo (so it only has code), but not miss out on user content changes?


Solution

  • I faced this issue several times.

    Simplest solution I found is to keep /files directory out of repos. Every developer will have a custom /files for local debugging.

    A couple of far more complex solution are:

    • Write some custom code to be used for developement which replace "local path to /files" with "production path to /files" (read only)
    • Share Filesystem containing production /files (carefully here, this is risky!)

    Also, you will need of course to define some backup strategy for your files.