代码之家  ›  专栏  ›  技术社区  ›  hong4rc 6ark

如何用CRLF强制Git提交?

  •  2
  • hong4rc 6ark  · 技术社区  · 6 年前

    如果我使用 autocrlf ,就像这里

                         push    clone
    1) true:             x -> LF -> CRLF
    2) input:            x -> LF -> LF
    3) false:            x -> x -> x
    

    但我想用CRLF自动提交Git:

    x -> CRLF (if I use LF, it will commit with CRLF)
    

    我能做吗?

    提前感谢!!!!

    编辑:我认为Git不支持,所以我强制更改 lf crlf 带[CRLF]。 1

    2 回复  |  直到 6 年前
        1
  •  1
  •   VonC    6 年前

    eol directive in a .gitattributes file

    # Declare files that will always have CRLF line endings on checkout.
    *.sln text eol=crlf
    

    git config --global core.autocrlf false




    git config --global core.autocrlf false
    

    core.eol text eol

    unix2dos

        2
  •  1
  •   user10445815    6 年前

    LF CRLF

    autocrlf=true

    推荐文章