wzy@DESKTOP-AFD56J4 MINGW64 /e/User/wzy/github/Vue3-learn (main) $ git add . warning: LF will be replaced by CRLF in hello_vue3/.gitignore. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/.vscode/extensions.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/README.md. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/env.d.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/package-lock.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/package.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/App.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/assets/base.css. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/assets/logo.svg. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/assets/main.css. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/components/HelloWorld.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/components/TheWelcome.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/components/WelcomeItem.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/components/icons/IconCommunity.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/components/icons/IconDocumentation.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/components/icons/IconEcosystem.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/components/icons/IconSupport.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/components/icons/IconTooling.vue. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/src/main.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/tsconfig.app.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/tsconfig.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/tsconfig.node.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in hello_vue3/vite.config.ts. The file will have its original line endings in your working directory
问题的原因
行尾符差异:
Windows 使用 CRLF (\r\n) 作为行尾符。 Linux 和 macOS 使用 LF (\n) 作为行尾符。
Git 的默认行为:
当配置了 core.autocrlf 为 true 时: 提交时,Git 会将 Windows 的 CRLF 转换为 LF。 检出时,Git 会将 LF 转换为 Windows 的 CRLF。 这有助于跨平台兼容,但在某些场景下会引发警告。