1

I would like to know if there are best practices for this situation:

  • a website with its source code in version control (e.g. git).
  • code makes references to specific assets like images, that can't be included in version control due to their size.

How to have in sync the code and images but keeping them outside the git branch?

My current approach for this is to upload the images directly to a server and then in the code just having a reference to the image URL but I would like to know more robust workflows to make backups and maintenance easier, and have clear snapshots .

asked May 11, 2017 at 21:41
4
  • 1
    Why can't images be kept in git because of their size? Are you using some cheap online tool with size limits? Commented May 11, 2017 at 22:08
  • @gnasher729 for example, a static site with HD photos in their posts, would it be acceptable to include them? Commented May 12, 2017 at 15:52
  • I always include a site's images in VC if they are part of the basic layout / presentation (logos, etc.), and I also include those that are part of the primary content created by the site owners.. This is distinct from images that are uploaded as part of a user comment. Disk is cheap, and DVCS's are amazingly fast, so you lose nothing by doing it. Commented May 14, 2017 at 0:03
  • i think this is a fairly common problem although not 'because of size' dont know of a sure fire solution though Commented May 14, 2017 at 13:00

1 Answer 1

0

[The text of this answer was originally written by Peter Rowell]

I always include a site's images in VC if they are part of the basic layout / presentation (logos, etc.), and I also include those that are part of the primary content created by the site owners.. This is distinct from images that are uploaded as part of a user comment. Disk is cheap, and DVCS's are amazingly fast, so you lose nothing by doing it.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.