Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change svg from text to binary in Common.gitattributes file #34

Merged
merged 1 commit into from
Dec 14, 2015

Conversation

compumike08
Copy link
Contributor

Change the *.svg file pattern from 'text' type to 'binary' type in 'Common.gitattributes' file.

Change the *.svg file pattern from 'text' type to 'binary' type.
@compumike08
Copy link
Contributor Author

Although SVG files are technically based on XML files (and so Git is technically capable of treating them as text files instead of binary), the best way for Git to handle SVG files is as binary. The Git manual page for gitattributes says in the section "Marking files as binary" that some types of files, while technically text files, can be marked as binary when their content is "opaque" to human readers (I'm paraphrasing the actual text from the Git manual). SVG files aren't meant to be viewed in their raw form by human users, and you will very rarely ever need to perform a diff on an SVG file. While I'm sure there are rare edge cases out there where someone has an unusual use-case that would benefit from treating SVG files as text in Git, the vast majority of users won't ever need to and treating them as text can just produce noisy and useless diffs. As this GitHub repository is intended to be a library of template .gitattributes files for others to use, I think these templates should reflect the most common use-cases. Those rare people who need to actually work with SVG files as text-based in Git can simply change it back to 'text' type in their local .gitattributes file that they are using in their actual project.

@danimoth

alexkaratarakis added a commit that referenced this pull request Dec 14, 2015
Change svg from text to binary in Common.gitattributes file
@alexkaratarakis alexkaratarakis merged commit c3c4e75 into gitattributes:master Dec 14, 2015
@alexkaratarakis
Copy link
Member

Sounds reasonable :). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants