开发者

Git index resets itself

开发者 https://www.devze.com 2023-01-02 17:26 出处:网络
Every so often when I run git add . to add new files to my repo my git index will reset and think all the files in the repo have been deleted. I run these commands:

Every so often when I run git add . to add new files to my repo my git index will reset and think all the files in the repo have been deleted. I run these commands:

git status
git add .
git status
git commit -a -m "Commit message"

everything looks fine at all those points until I commit and it says every file was deleted, all I have t开发者_如何学Co do it run git add . and commit again to get the files back, but this becomes a pain. And this doesnt happen every time, maybe about 40% of the time. Anyone know why this might happen?

I am on Mac OS 10.6.3 with Git 1.6.6


git add . -A

That will add to the index all of your new files, changed files and removed files.

Do you have any utilities running such as dropbox, or anti-virus, or any other software that can lock files or folders for a short time?

What does your commit history look like? Does the patch view show deletions of everything?

When you say repo, are you talking about the working folder or the actual contents of the .git folder?


My first instinct is that you've found a race bug of some kind. Does this happen if you do the following?

git add *
0

精彩评论

暂无评论...
验证码 换一张
取 消