[git] 多平台開發 windows和linux 換行符號

[git] 多平台開發 windows和linux 換行符號

  • 使用 Phpstorm,修改設定 Setting -> Editor -> Code Style -> Line separator,修改成 Unix and OX X (\n) 就行了
  • git 設定檔:
    • git config --global core.autocrlf input
      • true: 表示 checkout 專換成 CRLF,提交時轉換成 LF
      • input: 表示 checkout 不轉換,提交時轉換成LF
      • false: 表示不轉換
    • git config --global core.safecrlf true
      • true: 表示不允許提交時包含不同換行符號
      • warn: 在有不同換行符號存在時警告
      • false: 則允許提交時有不同換行符號存在
    • 新增 .gitattributes
      • * text eol=lf