This may sound like a redundant question (and may very well be a redundnant question) but I can\'t find the answer. Here\'s the situation:
My application is creating te
Git doesn’t appear to support CR line endings, so I would write a filter to convert the newlines. The files in the work tree will have CR line endings, and they will be transparently converted to LF when they are indexed. The filter has two parts: “clean” checks the files in, and “smudge” checks the files out.
Use this in .git/config
:
[filter "cr"]
clean = tr '\\r' '\\n'
smudge = tr '\\n' '\\r'
And .git/info/attributes
(or .gitattributes
if it should be versioned)
* filter=cr
Note that this automatically makes git-diff
happy, since it will use the “clean” version.
Just remember to set the pattern to just the files you need, or binary files will be corrupted and all text files will check out with CR line endings.
Also note that if the filter is not configured, it will silently fail, so add the config line when setting up a new copy of the repository.