Binary Files
While Git has a lot of strength, it has the same weakness that most source control systems have: binary files. While text files are just a series of characters in a row, binary files have internal structures that are used to read the file. A good example is the .docx
file format from Microsoft Word. You can easily rename it to have a .zip
extension instead of .docx
and open it up as a folder in most operating systems.
Binary files have their purpose. They are far more efficient at images. They allow Microsoft Word to format the document without significant amount of markup getting in the way of words.
However, they almost always require a custom program to view and edit. Also, because they are packed so tightly with structures, changing a single character could cause the entire file to appear to be different.
This is where Git struggles. When Git works with a text file, it can tell you that you renamed a character on Thursday and fixed a sentence on Friday. When it is a binary file, it can only tell you the file changed on Thursday and then again on Friday. It can't tell what changed, only that the file changed.
When there is a single person involved, this might not be a problem. But say you get an editor involve. Git can only tell you that your editor changed a file, but if it is text file, it can tell you the exact lines that were changed and the before and after of that change.
There are other reasons binary files aren't so great. It is out of scope of this garden plot, but if you want more details, check out the excellent How Git Works zine by Julia Evans.
Images
In many cases, it will be impossible to completely avoid binary files checked into Git. In those cases, it is better to have something that doesn't change frequently, such as interior graphics or or the cover after most of the back-and-forth edits are done.
This is because when you change a binary file, every change puts another copy into the Git repository. While it doesn't sound like much, if you have a 3 MB cover image checked in, then make a small change, it puts a second 3 MB cover image. A minor tweak then puts another 3 MB copy. As so forth.