git - 通过 .gitattributes 文件禁用行尾规范化
问题描述
如何通过 .gitattributes 文件禁用行尾规范化(行终止符)?或者更有用的是,对某些路径和/或文件禁用它。此外,我希望 Git 像往常一样显示文本文件的差异/合并。
由于有时您需要根据操作系统(即* text=auto
在.gitattributes
文件中使用)对文本文件的行尾进行规范化,如何实现排除?
解决方案
鉴于所有文本文件都在 .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
推荐阅读
- javascript - 检查先前的值是否已更改,如果已更改,请将更改前的先前值放入日志表中并在屏幕上打印该日志表
- tensorflow - 要建立什么样的神经网络模型来识别算法是 n*n?
- apache - 如何解释 apache mod 重写规则?
- javascript - Google Apps Script Doesn't Work When Embedded. TypeError: Cannot call method "getActiveSheet" of null
- php - 将变量从 Php 下拉列表传递到 Ajax
- sql - Hive 根据日期范围汇总表中的数据
- angular - mat-datepicker 上的多种 dateInput 格式
- python - 在 Python 中的混合效应模型中指定交叉随机效应的符号
- mysql - 如何构建一个 MySQL 查询来提取不同的对,并限制类别可以匹配的次数?
- javascript - 如何处理数组元素之一为空的JS破坏赋值?