How to Choose Between Git and Cloud Baseline Storage for Visual Tests
Git baselines are simple and versioned with code but bloat the repo, while cloud baselines keep the repo lean at the cost of an external service and token.
Decide by repo size and workflow: small suites suit committed PNGs, large suites suit a cloud store (Percy, Chromatic, reg-suit + S3) that keys baselines per branch.
Trade-offs
| Concern | Git baselines | Cloud baselines |
|---|---|---|
| Setup | None, just commit PNGs | Token and service integration |
| Repo size | Grows with every snapshot | Stays small |
| Review | Diff in the PR (binary) | Dedicated review UI |
| Branch baselines | Whatever is on the branch | Keyed per base commit |
Keep git baselines lean
Terminal
# Track large PNGs with Git LFS to avoid bloating history
git lfs track "tests/**/*.png"
git add .gitattributes && git commit -m "Track snapshots with LFS"Gotchas
- Binary PNG diffs are unreadable in a PR; a cloud UI shows side-by-side comparisons.
- Git LFS reduces clone size but adds a bandwidth quota to manage.
Related guides
How to Store Visual Baselines With reg-suit and S3 in CIUse reg-suit with the S3 publisher to keep visual baselines out of git, fetching the previous expected images…
How to Control the Cost of Visual Testing in CIReduce visual testing cost in CI by snapshotting only changed stories, trimming viewport and browser combinat…