如何修复:错误:'<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
问题描述
我正在尝试将一个 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屋!