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
相关推荐
秋风点枝15 分钟前
第一篇:认识 Argo CD —— 从传统发布到云原生 GitOps
git·云原生·argocd
葟雪儿1 小时前
本地项目上传到GitHub(小白篇)
git·github
CSDN_RTKLIB17 小时前
多次git add拆解
git
CSDN_RTKLIB18 小时前
git push -u
git
xiaoxiang960920 小时前
Git 分支同步实战:`merge -X theirs` 与完全合并方案
数据库·git·elasticsearch
李可以量化21 小时前
Redis Client 从了解到精通(二)下:String 类型进阶操作全解
redis·git·python·量化交易·qmt
wy31362282121 小时前
Git——ignore让项目的 target 目录真正被忽略(忽略其他文件也是同样的道理)
开发语言·git
deli0070071 天前
正则表达式可视化测试工具:输入即匹配,高亮一目了然
git·测试工具·正则表达式
爱莉希雅&&&1 天前
Git 版本控制完整学习笔记
笔记·git·学习