Search code examples
ruby-on-railsrails-activestorageruby-on-rails-5.2

Should Active Storage binary variant files get pushed to version control?


I've been playing around with my web app in development and uploading images to the app, and when I push to bitbucket it includes all of the (many) binary files in the storage folder. I haven't changed the default Active Storage configuration. Should this be happening?


Solution

  • No. The default .gitignore file for new Rails apps includes /storage/*:

    # Ignore uploaded files in development
    /storage/*
    

    If you’re using Git, ensure your .gitignore file contains the above. Otherwise, configure your VCS to ignore /storage/*.