“不会添加文件别名'samefile'('SameFile'已存在于索引中)'"当执行git add操作时 [英] "Will not add file alias 'samefile' ('SameFile' already exists in index)" when `git add` operation

查看:371
本文介绍了“不会添加文件别名'samefile'('SameFile'已存在于索引中)'"当执行git add操作时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了linux的内核源代码,并希望全部git add.

I download linux' kernel source, and want to git add them all.

当我git add .时,git开始添加它们.但是很快它返回一个错误:

When I git add ., git starts add them. But soon it returns an error:

fatal: Will not add file alias 'include/linux/netfilter/xt_connmark.h' ('include/linux/netfilter/xt_CONNMARK.h' already exists in index)

这很奇怪,xt_connmark.hxt_CONNMARK.h完全不同,为什么它抱怨该错误?这些情况也发生在其他文件夹中.我不能只是单独更改其名称来解决此问题.

That's weird, xt_connmark.h and xt_CONNMARK.h are TOTALLY DIFFERENT, why it complains that error? Those situations occur at other folders, too. I can't just change their names separately to solve this problem.

即使我尝试了git add --ignore-errors .,它也不起作用.它只是停下来而没有忽略此错误.有人知道解决方案吗?

Even I try git add --ignore-errors ., it doesn't works,too. It just stopped without ignoring this error. Anyone knows solutions?

推荐答案

编辑.git/config以将ignorecase设置为false

Edit .git/config to set ignorecase to false

[core]
  ignorecase = false

可以全局设置

$ git config --global core.ignorecase false

这篇关于“不会添加文件别名'samefile'('SameFile'已存在于索引中)'"当执行git add操作时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆