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 .
-
1Why can't images be kept in git because of their size? Are you using some cheap online tool with size limits?gnasher729– gnasher7292017年05月11日 22:08:54 +00:00Commented 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?marcanuy– marcanuy2017年05月12日 15:52:07 +00:00Commented 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.Peter Rowell– Peter Rowell2017年05月14日 00:03:51 +00:00Commented 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 thoughEwan– Ewan2017年05月14日 13:00:10 +00:00Commented May 14, 2017 at 13:00
1 Answer 1
[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.