如何修复:错误:'<filename>'没有提交检查致命:输入“git add."时添加文件失败.在命令提示符下 [英] How to fix: error: '<filename>' does not have a commit checked out fatal: adding files failed when inputting "git add ." in command prompt

查看:20
本文介绍了如何修复:错误:'<filename>'没有提交检查致命:输入“git add."时添加文件失败.在命令提示符下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一个 ruby​​ rails 文件添加到我在 gitlab 中的存储库中,但它以某种方式不允许我添加该文件,说我的文件没有签出提交.

I'm trying to add a ruby rails file to my repository in gitlab but it somehow wouldn't allow me to add the file saying that my file does not have commit checked out.

我尝试过 git pull,再次制作文件并添加 git,但仍然无法正常工作

I've tried git pull, making the the file again and git adding but still wont work

error: '172069/08_lab_routes_controllers_views_172069_172188-Copy/adventure_game/' does not have a commit checked out
fatal: adding files failed

推荐答案

如果你有一个带有 .git 目录的子目录并尝试 git add . 你会看到这条消息.

If you have a subdirectory with a .git directory and try to git add . you will see this message.

如果您有一个 git 存储库,然后在该存储库下的子目录中创建/克隆另一个存储库,则可能会发生这种情况.

This can happen if you have a git repo and then create/clone another repo in a subdirectory under that repo.

这篇关于如何修复:错误:'<filename>'没有提交检查致命:输入“git add."时添加文件失败.在命令提示符下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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