问题

git add .

一大串的warning

warning: in the working copy of 'App.vue', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages.json', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages/cart/cart.vue', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages/cate/cate.vue', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages/home/home.vue', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages/my/my.vue', LF will be replaced by CRLF the next time Git touches it

解决方案

解释:

CR/LF是不同操作系统上使用的换行符:

  • CR(CarriageReturn回车'\r'):回到一行的开头,ASCII代码是13

  • LF(LineFeed换行'\n'):另起一行,ASCII代码是10

1、windows用户

Git 可以在你提交时自动地把回车(CR)和换行(LF)转换成换行(LF),而在检出代码时把换行(LF)转换成回车(CR)和换行(LF)。因为git 的 Windows 客户端基本都会默认设置 core.autocrlf=true

git config --global core.autocrlf true

提交时转换为LF,检出时转换为CR、LF

2、linux/mac用户

Git 在检出文件时不需要进行自动的转换。然而当一个以回车(CR)和换行(LF)作为行结束符的文件不小心被引入时,你肯定想让 Git 修正。 所以,你可以把 core.autocrlf 设置成 input 来告诉 Git 在提交时把回车和换行转换成换行,检出时不转换:(这样在 Windows 上的检出文件中会保留回车和换行,而在 Mac 和 Linux 上,以及版本库中会保留换行。)Linux 最好不要设置 core.autocrlf,因为这个配置算是为 Windows 平台定制;

#提交时转换为LF,检出时不转换

$ git config --global core.autocrlf input

warning: in the working copy of ‘App.vue‘, LF will be replaced by CRLF the next time Git touches it相关推荐

  1. Git 提示 “warning: LF will be replaced by CRLF“的思考

      在windows平台进行 git add 时, 控制台有时会打印警告 warning: in the working copy of 'XXX.sh', LF will be replaced b ...

  2. git warning: LF will be replaced by CRLF in 解决办法

    windows中的换行符为 CRLF, 而在Linux下的换行符为LF,所以在执行add . 时会出现以下提示 warning: LF will be replaced by CRLF in pom. ...

  3. git warning: LF will be replaced by CRLF in 解决办法 1

    git warning: LF will be replaced by CRLF in 解决办法 按照这样设置就没有问题了: git config core.autocrlf false 这样设置gi ...

  4. 【Tools】git提示“warning: LF will be replaced by CRLF”的解决办法

    原文链接:https://blog.csdn.net/u012757419/article/details/105614028 一.发现问题 windows平台下使用git add,git deplo ...

  5. win10运行Git出现警告 :warning: LF will be replaced by CRLF in ...

    win10运行Git出现警告 :warning: LF will be replaced by CRLF in ... 1. 错误状态 2. 解决办法 1. 错误状态 win10环境下,在使用Git的 ...

  6. [GIT] warning: LF will be replaced by CRLF问题解决方法

     git crlf rails 开发环境: 操作系统: windows xp ruby 1.9.2 rails 3.1.3 git version 1.7.8.msysgit.0 问题描述: 启动 ...

  7. git 中使用git add . 命令时候报如下警warning: LF will be replaced by CRLF in …….

    git 中使用git add . 命令时候报如下警告 warning: LF will be replaced by CRLF in --. The file will have its origin ...

  8. warning: LF will be replaced by CRLF in The file will hav

    git add . 添加的时候报 warning: LF will be replaced by CRLF in ........ The file will hav 经过网上查找得意解决 https ...

  9. warning: LF will be replaced by CRLF in bispython/venv/Lib/site-packages/dja

    git添加时出现的错误 warning: LF will be replaced by CRLF in bispython/venv/Lib/site-packages/dja 解决:修改配置 git ...

最新文章

  1. Paddle 环境中 使用LeNet在MNIST数据集实现图像分类
  2. java 模块化_Java 9 新特性 - 模块化 - Java 技术驿站-Java 技术驿站
  3. helm部署hadoop并指定namespace和名称的命令
  4. 大数开方(Java版)
  5. iOS----------The app's Info.plist must contain an NSPhotoLibraryUsageDescription key
  6. 用Canvas画圆环百分比进度条
  7. 大牛领导单独找我聊了两句:搞框架的同时别忘了算法
  8. 文本文件和二进制文件的区别
  9. Struts2学习(四):Action执行的时候发生了什么
  10. shedlock 重启系统报错问题_闲谈ShedLock解决分布式定时任务重复执行问题
  11. MySQL join 与where的执行顺序
  12. 蓝桥杯2015年第六届C/C++省赛C组第一题-隔行变色
  13. 测试一下你真的理解数据库左连接了吗?
  14. u盘复制文件第二台计算机无文件夹,u盘做成启动盘后拷贝进去的文件不见了怎么办...
  15. [actions] -- actions详细使用
  16. 曾推出Anki Drive和Cozmo人工智能机器人的独角兽企业Anki谢幕
  17. 凭实力讲,运维工程师能不能做成预言家?
  18. 轻松玩转微信公众号排版
  19. 简述java什么是继承_Java 继承简述
  20. 51单片机控制步进电机-电路连接

热门文章

  1. 1范数+F范数求极小
  2. 关于godoc 不是内部命令问题解决
  3. 破坏计算机系统什么罪,破坏计算机信息系统罪的量刑标准是什么
  4. 渗透测试业务逻辑测试汇总—通用篇
  5. WinDbg基础(3)Adplus参数设置
  6. mysql中的时间类型和比较大小
  7. 图片怎么压缩到200k以内?图片压缩怎么指定大小?
  8. 分布式服务之边车模式
  9. Java数据按照时间排序
  10. git切换远程分支和tag操作