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 增加如下部分

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 either LF or CRLF 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
相关推荐
不知名。。。。。。。。2 小时前
Linux—— 版本控制器Git
linux·运维·git
JJ1M83 小时前
Git技巧:Git Hook,自动触发,含实战分享
git·python·自动化
服部6 小时前
如何查看指定作者在所有分支的提交记录
前端·git·github
大卫小东(Sheldon)8 小时前
使用DVC管理大文件变更历史(基于git)
git
晓龙的Coding之路9 小时前
如何通过git删除某个文件的历史提交记录
git·git删除指定文件log
手可摘星Chen12 小时前
commitlint安装和配置使用教程
前端·git
曾经的三心草15 小时前
Git-基本操作
大数据·git·elasticsearch
i_am_a_div_日积月累_16 小时前
git检查提交分支和package.json的version版本是否一致
git·json
反方向的空19 小时前
GIt基本操作
大数据·git·elasticsearch
阳光下的大嘴猴王1 天前
SVN仓库突然没有权限访问
svn