通过.gitattributes文件禁用行规范化结束

问题描述 投票:0回答:1

如何通过.gitattributes文件禁用行尾规范化(行终止符)?或更有用的是,对某些路径和/或文件禁用它。我也希望Git像往常一样显示文本文件的diff / merge。

由于有时您需要根据操作系统归一化文本文件的行尾(例如,在* text=auto文件中使用.gitattributes,因此如何实现排除?

git normalization line-endings eol gitattributes
1个回答
0
投票

鉴于所有文本文件都在.gitattributes文件中进行了规范化,我们可以使用!eol选项添加排除项:

# Auto detect text files and perform EOL normalization according to OS
* text=auto 

#Exclude certain file types from EOL normalization
*.csv !eol

#Exclude certain paths from EOL normalization
**/TestFilesPath/** !eol
© www.soinside.com 2019 - 2024. All rights reserved.