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 增加如下部分
bash
[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,放开#号,并增加对应的你使用的文件配置
bash
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