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
相关推荐
-拟墨画扇-4 小时前
Git | 文件提交操作
git·gitee·github·gitcode
CoderJia程序员甲4 小时前
GitHub 热榜项目 - 日榜(2025-12-25)
git·ai·开源·llm·github
-拟墨画扇-6 小时前
Git | 文件修改操作
大数据·git·gitee·github·gitcode
-拟墨画扇-6 小时前
Git | 版本控制操作
大数据·git·gitee·github
GA6666667 小时前
PowerWiki:基于 Git 的知识管理系统
git
-拟墨画扇-8 小时前
Git | 状态查看操作
git·gitee·github·gitcode
码灵8 小时前
Git相关软件常用操作
git
-拟墨画扇-9 小时前
Git | 简介与安装
大数据·git·elasticsearch
junlaii9 小时前
Windows Claude Code Git Bash 依赖修复教程
windows·git·bash
白完就是肥9 小时前
Git基本使用
git