22

phpstorm设置换行兼容Windows(CRLF)和Linux(LF)

 3 years ago
source link: https://blog.csdn.net/weixin_44000238/article/details/108399817
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

phpstorm设置换行兼容Windows(CRLF)和Linux(LF)

于现在大多数项目都是运行在 Linux 服务器上,很多PHP开发使用的是WINDOWS系统,最终导致在Windows上克隆的代码,提交到git上后,换行符都换成CRLF 了,在Linux平台上克隆下来也是 CRLF换行符…然后就裂开了

PHPStorm编辑器修改换行符

@version 2020PHPStorm配置截图

Setting配置路径

Git配置

Git命令行修改AutoCRLF

提交时转换为 LF,检出时转换为CRLF(推荐windows)
git config --global core.autocrlf true
提交时转换为LF,检出时不转换(推荐*unix/mac)
git config --global core.autocrlf input
提交检出均不转换
git config --global core.autocrlf false

Git命令行修改SafeCRLF

拒绝提交包含混合换行符的文件
git config --global core.safecrlf true
允许提交包含混合换行符的文件
git config --global core.safecrlf false
提交包含混合换行符的文件时给出警告
git config --global core.safecrlf warn

本文参考文献:phpstorm设置换行兼容Windows(CRLF)和Linux(LF)


Recommend

  • 77

    那些成功换行的人,都做对了什么?36氪的朋友们·2017-11-30 11:14女怕嫁错郎男怕入错行~ ...

  • 77
    • www.cnblogs.com 7 years ago
    • Cache

    谈谈换行 - stoneniqiu

    前几天表弟突然打电话给我说,经过四个月的学习Java,最近拿到了几个offer,不知道选哪家。一问,有老虎证券,摩拜单车,搜狐和滴滴。薪水都是2w+,年薪30万左右。其实这些都蛮不错,最后决定选择了滴滴。 说实话我蛮惊讶的,表弟是北航研究生,毕业两年一直...

  • 110

    正确使用「回车」和「换行」,让你的文档排版更好看 | 一日一技

  • 69
    • www.w3cplus.com 6 years ago
    • Cache

    CSS中最全的换行处理方式

    CSS中最全的换行处理方式

  • 18

    CRLF Injection漏洞的利用与实例分析 phith0n

  • 92
    • www.10tiao.com 6 years ago
    • Cache

    记一次换行引发的血案

    (点击上方公众号,可快速关注) 作者:怡红公子 imnerd.org/jsonp-lf-bug.html...

  • 11
    • www.aleksandrhovhannisyan.com 4 years ago
    • Cache

    CRLF vs. LF: Normalizing Line Endings in Git

    CRLF vs. LF: Normalizing Line Endings in Git If you’ve ever worked on a project where developers use different operating systems, you know that line endings can be a peculiar source of frustration. This issue of CRLF vs. LF line e...

  • 8
    • segmentfault.com 3 years ago
    • Cache

    PHPStorm多项目下Test Sources Root设置

    PHPStorm多项目下Test Sources Root设置最近用Lumen来做单元测试的时候遇到一个问题,就是用PHPStorm开了多个项目(用户侧和管理侧),这时候设置了Test Sources Root,会发现测试用例的命...

  • 12
    • exp-blog.com 3 years ago
    • Cache

    【Root-Me】 CRLF

    【Root-Me】 CRLF 题目有2个提示: 注入异常数据到日志(Inject false data in the journalisation log) 打开挑战页面后,发现三行初始日志,稍微分析下:

  • 6

    Apple Studio Display 2022款自入手以来我一直作为主显示器,合盖使用MacBook Pro。从未想过与Linux或Windows的连接。今日实测了iPad Pro、Linux、Windows与Studio Display的配套使用,发现均可正常兼容,包括摄像头、扬声器、麦克风以及下联TypeC接口,甚至也支持给...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK