Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Atom editor 在Atom中,我总是以混合行结尾_Atom Editor_Line Endings - Fatal编程技术网

Atom editor 在Atom中,我总是以混合行结尾

Atom editor 在Atom中,我总是以混合行结尾,atom-editor,line-endings,Atom Editor,Line Endings,我安装了一个包(),它可以告诉我文件中使用了哪些行尾(LF或CRLF或Mixed) 默认情况下,它是LF(这是我的首选),但在编辑过程中,它有时会变得混合,然后我总是必须手动将其设置回LF 当我忘记将所有行尾设置回LF,将具有混合行尾的文件推送到Github上,有人拉它,推他们的更改,而提交的一半只是他们的编辑器对文件所做的行尾更改,因为它具有自动行尾更正-不像我的 Atom也可以有这个功能吗?是否有办法确保(例如在保存时)文件的所有行尾都设置为LF?我找到了一个包(),它正好满足我的需要。我想

我安装了一个包(),它可以告诉我文件中使用了哪些行尾(LF或CRLF或Mixed)

默认情况下,它是LF(这是我的首选),但在编辑过程中,它有时会变得混合,然后我总是必须手动将其设置回LF

当我忘记将所有行尾设置回LF,将具有混合行尾的文件推送到Github上,有人拉它,推他们的更改,而提交的一半只是他们的编辑器对文件所做的行尾更改,因为它具有自动行尾更正-不像我的


Atom也可以有这个功能吗?是否有办法确保(例如在保存时)文件的所有行尾都设置为LF?

我找到了一个包(),它正好满足我的需要。我想知道为什么其他人没有同样的问题,为什么这个软件包的下载量如此之少。

您可以使用
.gittributes
来处理行尾:

    # Set the default behavior, in case people don't have core.autocrlf set.
    * text=auto

    # Explicitly declare text files you want to always be normalized and converted
    # to native line endings on checkout.
    *.c text
    *.h text

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

    # Denote all files that are truly binary and should not be modified.
    *.png binary
    *.jpg binary
相关:


或者,您可以使用来实现相同的目标。跨团队或开源贡献者实施一致的设置尤其有用。

谢谢!我接受了你的回答,因为它更一般