Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using git for images [closed]

Tags:

git

I'm considering using GIT or our family photos. The scenario is that both me and my girlfriend uses digital cameras, upload the photos to each our own computer. But still want to organize the photos into folders for different events, and have that organization replicated between our two computers.

By having the GIT repository master on our central server we can also view the images from our TV or access them through FTP if we need them while away from home.

This implies a structure where the images won't change very often. Rarely they'll get moved around. The most common action will be to add folder with new images to the repository and commit it to the master branch so the images are avaliable to everyone.

Now the question: How will the images be handled in Git? Will the Git repository be bloated up by maintaining an image for each version of the repository? Or will it only keep history of an image when it actually changes its content?

The difference in diskspace usages should be quite large for the two given scenarios.

like image 334
Morten Avatar asked Sep 01 '10 13:09

Morten


People also ask

Can I use Git for images?

Raster images and music files make as much sense to Git as they would to you if you looked at the binary data contained in a . png or . wav file. So Git just takes all the data and makes a new copy of it, even if only one pixel changes from one photo to the next.

How does Git LFS work?

How Does Git LFS Work? Git LFS uses pointers instead of the actual files or binary large objects (blobs). So, instead of writing large files/blobs to a Git repository, you write a pointer file, and the files/blobs themselves are written to a separate server. Plus, with Git LFS, multiple servers can be used.

Are GitHub images public?

Visibility and access permissions for container images If you have admin permissions to a container image, you can set the access permissions for the container image to private or public. Public images allow anonymous access and can be pulled without authentication or signing in via the CLI.


1 Answers

Every object in your repository will be stored once and referenced by it's SHA1 sum. This means that placing three copies of a 100KB image in two directories of your repo will use 100KB, plus some inconsequential amount of overhead.

The same applies to pushing, pulling and branching: So long as the SHA1 sum of the image doesn't change, git will never store a second copy or have to move more than one copy across the network.

You'll be using twice the disk space on each machine though: Git maintains a copy of all it's data in a hidden .git directory in the root of your repo.

like image 78
meagar Avatar answered Oct 08 '22 01:10

meagar