This thread is suggesting placing
*.jpg binary -delta
in the .gitattribute
file for repos in git but I am not sure what it does. I cannot find any examples of the '-delta' flag for git.
The purpose is to apparently speed up commit or push times for larger files.
That could be related to:
delta
Delta compression will not be attempted for blobs for paths with the attribute delta set to false.
I detail delta storage in "Is the git binary diff algorithm (delta storage) standardized?".
That isn't set by default of binary files because:
our originally intended target audience are people who use git as a source code control system.
I delta jpgs in one of my repositories. It is useful if the exif metadata changes but the image data does not. I assume you could do the same with other formats which have compressed and uncompressed portions (I also do it with video containers). I don't think it would ever make sense to try to delta gzip'd or bzip'd contents.
I also don't use "
binary
", as I use a custom diff driver instead (binary implies "-diff
").As for what should be the default, until now the default has always been that no gitattributes are defined by default. This is nice because it's simple to understand; git doesn't care about filenames unless you tell it to.
The downside obviously is that it may not perform optimally for some unusual workloads without extra configuration.
The .gitattributes
man page mentions:
The simplest way to mark a file as binary is to unset the diff attribute in the .gitattributes file:
*.ps -diff
This will cause Git to generate Binary files differ (or a binary patch, if binary patches are enabled) instead of a regular diff.
So, yes "Setting the "binary
" attribute also unsets the "text
" and "diff
" attributes as above", but Jeff was saying it was using only -diff
in his case, which was enough to lark the file as binary.