如何配置git repo,以便所有文件都以行尾LF(而不是CFLF)存储? [英] how to config git repo so that all files are stored with line-ending LF ( not CFLF ) ?
问题描述
对于特定的github回购(仅),我需要确保推送的所有文本文件都有LF行结束符(不是CRLF)。
此外, down回购文件应该保留LF行结束在客户端OSX或Windows上。
这可能吗? 尝试添加一个名为 .gitattributes
的文件并附带以下内容: :
* eol = lf
到您的回购。然后,无论开发者使用什么设置,所有文件将始终使用 请记住,它会将 For a specific github repo ( only ) I need to make sure that all text files pushed have LF line-ending ( not CRLF ). Further, pulled-down repo files should retain LF line-ending on clients either OSX or Windows. Is this possible ? Try to add a file named to your repo. Then no matter what settings for Just keep in mind, that it will change 这篇关于如何配置git repo,以便所有文件都以行尾LF(而不是CFLF)存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! LF
。
CRLF
更改为 LF
在二进制文件中提交(例如zip,jar,png等)。.gitattributes
with the following contents:* eol=lf
core.autocrlf
developers use, all the files will always use LF
. CRLF
into LF
upon commit in binary files also (like zip, jar, png, etc.).