本文主要是介绍git and svn 行尾风格配置强制为lf,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
git
CLI配置:
// 提交时转换为LF,检出时转换为CRLF
git config --global core.autocrlf true
// 提交时转换为LF,检出时不转换
git config --global core.autocrlf input
// 提交检出均不转换
git config --global core.autocrlf false
图形配置:
进入setting, 点git
.gitconfig 增加如下部分
[core]autocrlf = input
svn
svn:eol-style
LF
: Set end-of-lines automatically to Unix line endings upon checkout and commit.CRLF
: Set end-of-lines automatically to Windows line endings upon checkout and commit.native
: This will store line endings upon commit to Unix line endings (LF
), but will checkout the line endings with eitherLF
orCRLF
based upon the client.
图形配置实例:
win11 : TortoiseSVN setting
默认有# enable-auto-props = yes,放开#号,并增加对应的你使用的文件配置
enable-auto-props = yes
# Add these for each text file type that you use:
*.txt = svn:eol-style=native
*.cs = svn:eol-style=native
*.xml = svn:eol-style=native
*.c = svn:eol-style=native
*.h = svn:eol-style=native
Makefile = svn:eol-style=native
这篇关于git and svn 行尾风格配置强制为lf的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!