Can someone help me. I am using Git (GitHub) and trying to decide what to set my *.sql
files to in the gitattributes. I've seen people use
*.sql diff=astextplain
*.sql diff
*.sql text=auto
I was advised to set this to the second option, but I am just wondering what is the difference between that and the other two.
diff=astextplain
(msysGit only): converts those files (under the condition that their extension be *.doc
, *.pdf
, *.rtf
, etc.) to a text format before generating their diff.diff
: treat those files as plain text for generating their diff.text=auto
: automatically normalize EOL characters (to LF) in files deemed to be text files by Git.diff=astextplain
The string value astextplain
is not part of Git core: in fact, running
git grep "astextplain"
in the Git project repository returns nothing. As far as I can tell, it's a shell script that ships with msysGit and allows you to convert files such as
to a text format before generating their diff.
diff
According to the gitattributes
man page:
The attribute
diff
affects how Git generates diffs for particular files. [...]A path to which the
diff
attribute is set is treated as text, even when they contain byte values that normally never appear in text files, such as NUL.
text=auto
According to the gitattributes
man page:
When
text
is set to "auto", the path is marked for automatic end-of-line normalization. If Git decides that the content is text, its line endings are normalized to LF on checkin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With