Comments (11)
配置为 lf 在 windows 上不会造成什么问题,同时还能兼容 linux 等系统
from v3-admin-vite.
一般 git 的 core.autocrlf 设置为 true,所以在 windows 上 checkout 之后都会是 crlf,用VSCode修改保存后又会变成 lf
from v3-admin-vite.
这一块不是很熟悉,有文档参考吗
from v3-admin-vite.
其他项目类似的问题:frintjs/frint#286
from v3-admin-vite.
我大致看了一下,感觉依旧是配置为 end_of_line = lf 比较通用:
- windows 上 的 git core.autocrlf 为 true 时,在 windows 上 checkout 之后会是 crlf,由于配置了 end_of_line = lf,修改保存后又会变成 lf,但是不论是 crlf 还是 lf,vscode 都能自动适应,所以此时不会产生任何问题。在 git 提交代码时,最终会以 lf 模式进行提交,此时也不会有任何问题。
- 但是当 windows 上 的 git core.autocrlf 为 fasle 时,配置 end_of_line = lf 的好处似乎就突显出来了,因为这能尽可能的使提交到 GitHub 上的代码是 lf 模式,能兼容更多的操作系统。
- 绝大多数情况下, end_of_line = lf 这个配置似乎都是可要可不要的状态,所以感觉没必要移除它。
不知道你还有没有其他建议给我这边参考?
from v3-admin-vite.
git提交不会有任何问题,但是在 windows 上修改保存然后撤销修改后,也会被 git diff 出来
$ git diff
warning: LF will be replaced by CRLF in src/store/modules/permission.ts.
The file will have its original line endings in your working directory
只有在执行 git add 之后才会消失
from v3-admin-vite.
哦对,这个问题我是知道的,我一直选择容忍它。
from v3-admin-vite.
但是如果删了 end_of_line = lf,真的不会造成更多问题吗?比如 git core.autocrlf 为 fasle 时
from v3-admin-vite.
是的,但好在 git 安装默认会选上的。如果有人的提交是 crlf ,一般也能在 review 时看出来。如果这个项目有很多新手使用,这个地方确实会造成一些迷惑。所以 whatever,看你怎么考虑了。
from v3-admin-vite.
我可能会先保留这个配置,在我不是完全掌握这个配置的情况下。我只能参考更优秀的作者和开源项目。比如托尼的:https://github.com/antfu/vitesse/blob/main/.editorconfig
from v3-admin-vite.
你可以加一下我的微信,我拉你进一下维护群
from v3-admin-vite.
Related Issues (20)
- 内容区全屏 下拉框内容,弹窗内容无法显示 HOT 2
- request help: in /src/views/dashboard/index.vue, when and how the roles was set HOT 1
- 能不能把登录模块给去掉 HOT 3
- 怎么感觉meta.hidden不能用?是我使用方法有问题? HOT 4
- 推荐将sass的@import都改为官方推荐的@use HOT 2
- 接口404
- 为什么“是否开启动态路由功能”的变量名是async而不是dynamic HOT 1
- 开启全屏后顶部存在一个margin HOT 8
- 项目启动错误, Cannot find package 'fast-glob' HOT 3
- 接口报错了 HOT 1
- 登录页增加背景图片 HOT 1
- 权限指令写法有问题 HOT 1
- 表格高度撑满自适应问题 HOT 1
- 表格固定后,透明了 HOT 1
- 更新到最新后自定义主题好像不生效了 HOT 2
- iPhone 手机用浏览器访问本地开发环境在登录成功之后白屏 HOT 5
- 这个页面好多黄色波浪线警告 HOT 1
- serive 流式接口 HOT 1
- 为什么模块和组件都正常的引入也可以使用,但编辑器一直报找不到模块呢 HOT 1
- 页签问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v3-admin-vite.