简体   繁体   English

Git将所有文件标记为已删除

[英]Git marked all files as deleted

This has happened before so I am not sure what the cause is. 这是以前发生的,所以我不确定是什么原因。 I am using a Git repository on a RedHat install. 我在RedHat安装上使用的是Git存储库。 Randomly the repository will have all of it's files marked as deleted but running git add . 仓库将随机地将所有文件标记为已删除,但运行git add . and run git status again it shows no changes. 并再次运行git status ,它没有显示任何更改。 I am unsure of what is causing Git to think I deleted these files. 我不确定是什么导致Git认为我删除了这些文件。 Anybody have a suggestion? 有人有建议吗?

You can try with git add -u . 您可以尝试使用git add -u . to add the deleted files, it will take care of adding the renamed and deleted files. 要添加已删除的文件,它将负责添加重命名和已删除的文件。

Check for processes that have handles on files in your local repository. 检查对本地存储库中的文件有处理的进程。

If this ever happens again, check the files in your local GIT repository and see if there are any .temp files that aren't part of master. 如果再次发生这种情况,请检查本地GIT存储库中的文件,并查看是否有不属于master的.temp文件。 Then check in Process Explorer if anything has a handle on them. 然后在Process Explorer中检查是否有任何句柄。 Close the handles and things should get cleaned up. 合上手柄,应清理东西。 Or, you could always turn your PC off and on again. 或者,您始终可以关闭计算机然后再打开。

I hit this where I created a new file and somehow IE created a handle on "newfile.xml.temp" or something like that. 我在这里创建了一个新文件,并在某种程度上IE在“ newfile.xml.temp”上创建了一个句柄。 I closed IE and things were fine. 我关闭IE,一切都很好。

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

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