How to modify the directory located by git in vscode

I want to use git, in vscode, but I find that the git directory detected in vscode is not consistent with my actual git directory. My git project is in the project folder of the desktop, but the directory displayed by git in vscode is the desktop. How to solve this?
Baidu has not found any valid information for a long time. I would like to ask for your help to answer it. Thank you.

Mar.10,2021

check your project directory to see if there is a hidden directory ".git". If this directory is in peoject, when you open project with vscode, it will only recognize the files in this folder. However, if there is a ".git" folder on your desktop, and you use vscode to open exactly the desktop folder desktop, then vscode will definitely think that this directory is your project directory.
vscode's git is basically used out of the box every time, but I've never configured it anyway. It should be that when you initialize the project, the initial git directory: git init operation is carried out in the project parent directory, so you are now in this situation

Menu