I want to version control my Magento 2 site project, it has lots of catalog images. All .gitignore templates I found online are excluding from /pub/media , why is that?

There are different cases where another developer might need the images also Also, if I want to deploy to live server, lets say AWS EC2 using git, (pulling from the remote repo) the images would be missing.

Can the experts please give me some insight on this issue?

  • I think these images under /pub/media doesn't must save in repo. Process of development don't influence from these. Mar 22, 2018 at 16:24
  • My gitignore simply - github.com/elevinskii/deepfish/blob/master/.gitignore Mar 22, 2018 at 16:26
  • but if you dont save the images in repo (theme images and/or catalog images) , how is other developer work on the site without the images, if he needs them? Also if I deploy to live, by pulling from master, the site will be missing the catalog images
    – faniva
    Mar 22, 2018 at 16:50
  • @EvgenyLevinsky your link is broken can you post again?
    – Alex B
    Oct 22, 2020 at 11:43

1 Answer 1


Images are not required for a project to run, which should be the point for a code repository

Imagine a 200k sku's catalog with all catalog images inside git repository... what a size! https://softwareengineering.stackexchange.com/questions/80962/should-images-be-stored-in-a-git-repository

Isn't it easier to just download them from staging / production environments to local environment?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.