Git_CRLF_warning

Handle conflicts related to LF and CRLF line endings--refers?CRLF_warning

Quite often, people working in a team and contributing to the same repository use different operating systems. This may result in problems with line ending, because Unix, Linux and MacOS us?LF, and Windows uses?CRLF?to mark the end of a line.

IntelliJ IDEA displays the discrepancies in line endings in the?Differences Viewer, so you can fix them manually. If you want Git to solve such conflicts automatically, you need to set the?core.autocrlf?attribute to?true?on Windows and to?input?on Linux and MacOS (for more details, see?Dealing with line endings?). You can change the configuration manually by running?

git config --global core.autocrlf true?on Windows or?

git config --global core.autocrlf input?on Linux and macOS.

However, IntelliJ IDEA can automatically analyze your configuration, warn you if you are about to commit?CRLF?into a remote repository, and suggest setting the?core.autocrlf?setting to?true?or?input?depending on your operating system.

To enable smart handling of?LF?and?CRLF?line separators, open the?Settings/Preferences?dialog??,, and select the?Version Control | Git?node on the left. Enable the?Warn if CRLF line separators are about to be committed?option.


?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容