Should Images Be Stored in a Git Repository?

gitgithubversion control

For a distributed team that uses Git and Github as version control, should images also be stored in the git repository?

For the most part, the images won't be changed. The folder containing them will only grow in size as images are added. A concern is that the image folder may grow to a large size over time by combination of large images, or just a lot of them.

Is this considered a best practice? What other alternatives are there to sharing binary files needed in projects that a distributed team can easily access?

Best Answer

Are your images original work or can they be recovered (guaranteed?) from elsewhere? Are they needed to ship a software unit built from source? If they are original, they need backing up. Put them in your revision control, if they never change, the space penalty is the same as a backup, and they are where you need them.

Can they be edited to change the appearance of the software, accidentally or intentionally? Yes - then they MUST be revision controlled somehow, why use another way when you have a perfect solution already. Why introduce "copy and rename" version control from the dark ages?

I have seen an entire project's original artwork go "poof" when the graphics designer's MacBook hard drive died, all because someone, with infinite wisdom, decided that "binaries don't belong in rev control", and graphics designers (at least this one) don't tend to be good with backups.

Same applies to any and all binary files that fit the above criteria.

The only reason not to is disk space. I am afraid at $100/terabyte, that excuse is wearing a bit thin.

Related Topic