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

  • 關於本站
  • 免責聲明