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?
Well... it's in the comments, but for visibility:
This happens if you have a
GIT_DIRenvironment variable pointing to a particular repository.GIT_DIRoverrides the normal directory-search rules for finding the.gitfolder and simply says "you're in a repo and the metadata is here".Generally I would clear the
GET_DIRvariable, and only set it when needed. I'm not sure what purpose you have it set for, and to the extent that purpose is still a thing, you may have to do some other stuff first to make sure it's set when it should be. But I can say the only times I've ever usedGET_DIRare in scripts (and then I make sure to clear it when the script's work is done) and I can't think of why you'd want it set all the time - for the reason you've just experienced.