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
相关推荐
16年上任的CTO31 分钟前
git基础使用--4---git分支和使用
git·gitee·git分支
16年上任的CTO31 分钟前
git基础使用--1--版本控制的基本概念
git·gitee·版本控制
wdxylb4 小时前
GIt使用笔记大全
笔记·git·elasticsearch
maply15 小时前
VSCode 中的 Git Graph扩展使用详解
ide·git·vscode·编辑器·扩展
行十万里人生19 小时前
Qt事件处理:理解处理器、过滤器与事件系统
开发语言·git·qt·华为od·华为·华为云·harmonyos
会敲代码的Steve1 天前
git笔记-简单入门
笔记·git
画船听雨眠aa1 天前
gitlab云服务器配置
服务器·git·elasticsearch·gitlab
Tangcan-2 天前
Linux中基础开发工具(yum,vim,gcc/g++,git,gdb/cgdb)
linux·git·vim
苏-言2 天前
Git进阶之旅:分支管理策略
git
初级代码游戏2 天前
git:恢复纯版本库
git·恢复·纯版本库