gitgit-branchgit-status

Git status fatal error: working tree directory


When trying to git status I get the following

git status fatal: not a git repository: D:/path/path/path/.git/worktrees/horus_app_v100

the path worktrees/horus_app_v100 doesn't exist

I recently deleted a worktree named horus_app_v100 and its branch, but it seems that there is something connected, so I can't git status.

There is no worktree called horus_app_v100, cuz I deleted, there is only my main worktree (1 worktree), but git status seems to be trying to reach a directory/worktree that doesn't even exist


Solution

  • There was a file (which I don't know how was there, maybe I created trying to fix the problem) called .git [ file, not the folder]. This file was inside one of the child folders of my project. The content of the file was something like gitdir = 'path to the deleted worktree [D:/path/path/path/.git/worktrees/horus_app_v100] . With this file inside, Git didn't even recognized the child folder as part of the Git repository. So I deleted this file (.git) and everything seems to work now.