删除子模块后出现错误:.gitignore文件之一忽略以下路径: [英] Error after removing submodule: The following path is ignored by one of your .gitignore files:

查看:78
本文介绍了删除子模块后出现错误:.gitignore文件之一忽略以下路径:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

删除子模块后出现此错误.有问题的路径不在我的.gitignore文件中,也没有在我的.git/info/exclude文件中相关的任何内容.我没有.gitignore_global文件.为什么git试图忽略此路径,我该如何解决?

I'm getting this error after I've removed a submodule. The path in question is not in my .gitignore file, nor is there anything relevant in my .git/info/exclude file. I don't have a .gitignore_global file. Why is git trying to ignore this path and how can I fix this?

The following path is ignored by one of your .gitignore files:
MyTest/MyTest/lib/submodules/ScreenRecorder
Use -f if you really want to add it.

这是我要执行的命令:

git submodule add https://github.com/kishikawakatsumi/ScreenRecorder.git MyTest/MyTest/lib/submodules/ScreenRecorder

这是从我的git repos根目录执行的.

This is being executed from my git repos root directory.

推荐答案

在我的.git/config中删除相关的[submodule]节为我解决了这个问题.

Removing the relevant [submodule] stanza in my .git/config solved the issue for me.

我的猜测是,superrepo将自动忽略子模块中的所有文件,因为它们不会被跟踪.因此,如果您的配置中有一个杂散的[submodule]节,则git会将路径添加为忽略模式.

My guess that the superrepo will automatically ignore all files in submodules since they are not tracked. Therefore, if there is a stray [submodule] stanza in your config, git will add the path as an ignore pattern.

这篇关于删除子模块后出现错误:.gitignore文件之一忽略以下路径:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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