这个是由于unix系统的换行符和windows的换行符不一致造成的结果。你在安装git的时候,设置了成使用LF,即unix换行符,可是你是在windows下进行文件编辑的,所以会出现上面的警告。其实这也没什么问题的,git只是自动帮你将windows换行符替换为Unix换行符。

I faced similar issues and decided to have a closer look to my configuration.

New Line Characters on Windows / Linux / MAC:

  1. MAC OS before X: \r = CR (Carriage Return)
  2. MAC OS X / UNIX: \n = LF (Line Feed)
  3. Windows: \r\n = CR + LF

Don't panic. Git can handle the conversion between platforms for you.

Git should store the line ending as LF in the repo.

Set it to;

TRUE - If you are on Windows:

git config --global core.autocrlf true

This converts LF endings into CRLF when you check out code.

INPUT - If you are on a MAC/LINUX:

You don't need to convert anything, Git uses LF and your MAC uses LF.

But, you can tell git to convert any CRLF if one pass through:

git config --global core.autocrlf input

False - Not recommened

I don't recommend this, but just for the sake of this explanation:

If you are a windows dev only working on windows machine and you are 100% sure you will never work with people on MAC:

git config --global core.autocrlf false

UPDATE:

As commented below, I didn't mention the .gitattributes where one can default these settings for a project.

If you havetime, here is the doc: http://git-scm.com/docs/gitattributes

git gui :Updating the Git index failed. A rescan will be automatically started to res的更多相关文章

  1. 删除右键菜单中的Git Gui Here、Git Bash Here的方法

    修改注册表的方法: 1.点击左下角开始菜单 - 运行(输入regedit)- 确定或者回车: 2.在打开的注册表中找到:HKEY_CLASSES_ROOT,并点HKEY_CLASSES_ROOT前面的 ...

  2. GIT GUI的使用(转)

    前段时间跟着Ruby On Rails的toturial玩了一把Git,今天再回过头来,觉得这个版本控制工具真的很不错.下面来讲一下,在windows下如何通过git gui来管理代码. 首先,要在h ...

  3. Git GUI 的使用

    下面,我们开始使用Git Gui 如果你想init一个本地的git仓库,到你的代码根目录下,右键选择Git Init Here 这时,你会发现在代码根目录下,生成了一个.git的隐藏属性目录. 再选择 ...

  4. How to get started with GIT and work with GIT Remote Repo

    https://www.ntu.edu.sg/home/ehchua/programming/howto/Git_HowTo.html#zz-7. 1.  Introduction GIT is a ...

  5. git的使用以及git和码云的连接

    什么是git? ​ Git是一个开源的分布式版本控制系统,可以有效.高速地处理从很小到非常大的项目版本管理.可以保存许多的历史版本,并且可以多人同时进行开发. 分布式版本控制系统 ​ 每个人拥有该项目 ...

  6. 『现学现忘』Git基础 — 4、Git下载与安装

    目录 1.Git下载 2.Git在Windows下的详细安装 3.验证Git是否安装成功 1.Git下载 进入官方地址下载Git客户端:https://git-scm.com/download/win ...

  7. win下 git gui 使用教程

    现在很多都有git来托管项目或者来查找资料,但是看起来操作不是很方便,现在由于win下可以直接使用git gui,让使用git变得方便,当然这只是针对日常简单的使用,如果想详细的使用,可以去参考廖学峰 ...

  8. 图解Windows下 GIT GUI 使用教程

    https://jingyan.baidu.com/article/19020a0a7ae6af529c284248.html 本篇经验将和大家介绍Windows下 GIT GUI 使用教程,希望对大 ...

  9. 【github&&git】3、git图像化界面GUI的使用

    GIT学习笔记 一.        基础内容 1.git是一个版本控制软件,与svn类似,特点是分布式管理,不需要中间总的服务器,可以增加很多分支. 2.windows下的git叫msysgit,下载 ...

随机推荐

  1. 【树上主席树】BZOJ2588-Count on a tree

    [题目大意] 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权.其中lastans是上一个询问的答案,初始为0,即第 ...

  2. 精通android体系架构、mvc、常见的设计模式、控制反转(ioc)

    1.请看某个著名的it公司一则招聘信息的其中一条要求:“熟悉android系统架构及相关技术,1年以上实际android平台开发经验:”,里面非常明确的说道要求熟练android系统架构,这从某种程度 ...

  3. pat 素数对猜想

    让我们定义d​n​​为:d​n​​=p​n+1​​−p​n​​,其中p​i​​是第i个素数.显然有d​1​​=1,且对于n>1有d​n​​是偶数.“素数对猜想”认为“存在无穷多对相邻且差为2的素 ...

  4. bzoj 4766: 文艺计算姬 -- 快速乘

    4766: 文艺计算姬 Time Limit: 1 Sec  Memory Limit: 128 MB Description "奋战三星期,造台计算机".小W响应号召,花了三星期 ...

  5. redis的原子性

    什么是原子性操作 在多进程(线程)访问共享资源时,能够确保所有其他的进程(线程)都不在同一时间内访问相同的资源,(要么完全执行,要么完全不执行) 简单描述 有个变量X=0,要进行+1操作,步骤如下: ...

  6. Codeforces Round #300 B. Quasi Binary 水题

    B. Quasi Binary Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/538/probl ...

  7. iOS 发光字流水

    { CAGradientLayer *_gradientLayer; NSInteger count; } - (void)addLabel{ // 创建UILabel UILabel *label ...

  8. External components provide true shutdown for boost converter

    The step-up switching-converter circuit in Figure 1 presents a familiar problem: If you shut down bo ...

  9. ZEN056V130A24LS/ZEN132V130A24LS TVS 二极管 - 瞬态电压抑制器 5.6V/13.2V 保护

  10. libgdx与Robovm绑定的坑

    https://github.com/BlueRiverInteractive/robovm-ios-bindings