【问题标题】:Force LF eol in git repo on all platforms with .gitattributes使用 .gitattributes 在所有平台上的 git repo 中强制 LF eol
【发布时间】:2015-02-21 18:59:06
【问题描述】:

我有一个远程 repo,它正在被克隆并在 windows 和 mac 上工作。我希望每当有人拉这个 repo 时,它应该在任何平台上自动使用 LF eol。

每当 Windows Build Server 拉取存储库时,都会出现我的主要问题。我无法控制在服务器上执行任何配置命令,所以我只想使用 .gitattributes 文件来解决这个问题。 LF的原因是有一些构建工具要求源文件是LF eol。

此文件是否表示所有文本文件都将使用 LF eol 检出,同时跳过 jpg 和 png 文件?如果不是,这个文件看起来像什么?

.gitattributes 文件

* text=auto eol=lf
*.jpg binary
*.png binary

【问题讨论】:

    标签: git eol gitattributes


    【解决方案1】:

    试试吧

    text eol=lf
    

    Git 将始终在结帐时将行尾转换为 LF。

    text=auto 将使用 git 默认值,这可能在所有地方都不相同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-16
      • 1970-01-01
      • 2020-10-03
      • 2015-06-08
      • 2018-03-17
      • 2017-03-21
      • 1970-01-01
      • 2014-02-13
      相关资源
      最近更新 更多