using git for images [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this questionI'm considering using GIT or our family photos. The scenario is that both me and my girlfriend uses digital开发者_如何学Python 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.
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.
I think you should consider using rsync. From what I understood you just want to synchronize your network folders, right? Is there a real need for versioning?
It is smart enough to only track changes and not create a full replica of the image repository
精彩评论