简体   繁体   English

源树git repo停止跟踪不存在的文件

[英]source tree git repo stop tracking a file that doesn't exist

I just was working on a branch, and when I went to make a commit a file appeared to be tracked that I seemed to have created unintentionally as some stage. 我只是在一个分支上工作,当我进行提交时,似乎跟踪了某个文件,在某个阶段我似乎是无意创建的。

The problem is that this file doesn't exist anymore and I cant stop tracking something that doesn't exist 问题在于此文件已不存在,我无法停止跟踪不存在的内容

fatal: pathspec 'app/HttpControllers/Admin/Logic.php' did not match any files'

I have no idea how this happened, but how can I get rid of it because i can't merge the branch as it says I still have a file in my working directory. 我不知道这是怎么发生的,但是如何摆脱它,因为我无法合并分支,因为它说我的工作目录中仍然有一个文件。

Just a note, I can't stage this file because it doesn't exist. 请注意,我无法暂存该文件,因为它不存在。 So I am out of idea's. 所以我没主意了。

I cant stop tracking something that doesn't exist 我无法停止追踪不存在的东西

It may not exist on the disk anymore, but it could still be referenced in the index. 它可能不再存在于磁盘上,但仍可以在索引中引用它。 Check the output of git ls-files . 检查git ls-files的输出。

If you see it, you can remove it from the index: 如果看到它,可以将其从索引中删除:

git rm --cached -- app/HttpControllers/Admin/Logic.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM