I see a deleted local file on my working tree and it is driving me crazy. Here is what is happening:
I clone the remote repo to my local machine:
git clone <my repo>
I checkout master and view its status
git checkout master
git status
And even though I have not done anything with it, I see this file deleted from my local machine
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: xyz.PNG
no changes added to commit (use "git add" and/or "git commit -a")
I can see this file on the remote repo. And sure enough, if I do:
git reset --hard HEAD
or
git checkout .
The file appears back and the status is clean again.
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
But if I checkout some other branch, and then switch back to master again, the delete message turns up again. It is almost as if there is something that is deleting this one specific file from my local every time I switch to master, but I have no idea what that would be.
I have looked at Unstaged changes show file as deleted even though it exists and there does not seem to be a space in the filename (no quotes around file name):
git status --short
D xyz.PNG