When I type git status
in any folder it lists the status of one of my git projects, compared to the current folder. Even when I am in another git project. Also, if I cd
to /root
folder and check there is no .git
folder present and type in git status
I will see the status of that folder against my git project.
Is there some default mapping in git, global config looks ok?
When you have
GIT_DIR
set in the environment, but not alsoGIT_WORK_TREE
, then you are operating Git outside its specifications. Either:Remove
GIT_DIR
from the environment and let Git discover the.git
directory itself,Or set
GIT_WORK_TREE
as well to point to the worktree corresponding to theGIT_DIR
.But, frankly, the latter is really not how one wants to operate Git during regular work. You should do the former.