close

vscode 右下角可以選 CRLF or LF

windows 是用 CRLF

linux 是用 LF

會需要注意這個是因為在 windows 上開發 linux 需要使用的 script 需要特別注意

CRLF 的 script 可不能在 linux 上執行, 必須轉成 LF

除了 vscode 用選的轉換之外還有個工具 dos2unix 也可以

https://linux.die.net/man/1/dos2unix

另外要提一下雖然 commit 已經是 LF 但是 clone 下來卻變成 CRLF

可以注意一下 git config core.autocrlf 看一下設定

把他設定成 false 才不會被自動改掉

https://stackoverflow.com/questions/48692741/how-can-i-make-all-line-endings-eols-in-all-files-in-visual-studio-code-unix

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JohnDX 的頭像
    JohnDX

    我要回家想一想~

    JohnDX 發表在 痞客邦 留言(0) 人氣()