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
相关推荐
kobe_OKOK_1 天前
Git Tag 用法记录
git
假女吖☌1 天前
Git_Rebase
git
007php0071 天前
大厂深度面试相关文章:深入探讨底层原理与高性能优化
java·开发语言·git·python·面试·职场和发展·性能优化
Jonathan Star1 天前
嵌套 Git 仓库(Submodule/子模块)
大数据·git·elasticsearch
东方欲晓w1 天前
Git高效开发:常用命令速查指南
git·stm32·学习
_Power_Y1 天前
Linux&git入门&设计模式(常考点)
linux·git·设计模式
刘永鑫Adam1 天前
代码管理及Linux模拟工具Git for Windows安装使用教程
linux·运维·服务器·git
moringlightyn2 天前
进度条+ 基础开发工具----版本控制器git 调试器gdb/cgdb
笔记·git·其他·c·调试器·gdb/cgdb·进度条 倒计时
逐风&者2 天前
windows SVN 修改提交作者、提交注释、提交日期
svn
rain bye bye2 天前
svn: E155000:
svn