logo
  • 教程列表
  • SO官方文档
  • 使用 .gitattributes 文件
    • 自动线路结束标准化
    • 识别二进制文件
    • 禁用行结束标准化
    • 预填充 .gitattribute 模板
  1. StackOverflow 文档
  2. Git 教程
  3. 使用 .gitattributes 文件
  4. 自动线路结束标准化

自动线路结束标准化

Created: November-22, 2018

在项目根目录中创建 .gitattributes 文件,其中包含:

* text=auto

这将导致所有文本文件(由 Git 标识)使用 LF 提交,但根据主机操作系统默认检出。

这相当于推荐的 core.autocrlf 默认值:

  • Linux / macOS 上的 input
  • 在 Windows 上使用 true
  • 识别二进制文件
  • 使用 .gitattributes 文件

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明