简体   繁体   中英

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. Randomly the repository will have all of it's files marked as deleted but running git add . and run git status again it shows no changes. I am unsure of what is causing Git to think I deleted these files. Anybody have a suggestion?

You can try with 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. Then check in Process Explorer if anything has a handle on them. 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. I closed IE and things were fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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