I have had a few strange issues with VSCode git integration versus working in the integrated terminal.
For example, sometimes the git integration in VSCode and and in the terminal disagree with each other, and sometimes the terminal's history is apparently corrupted by VS Code. See my question here: Why do I get a different git status in a shared folder when logged in on a local VM?
I haven't entirely sorted out why this occurs, so I can't guarantee that it is the same problem as you are finding, but it could be related.
I had the same issue and what worked for me is to disable Git: Terminal Authentication in the settings. It will prompt the username and the password in the terminal. Hope that this solution/workaround is good for other people.
From this site I found this solution/workaround: https://github.com/microsoft/vscode/issues/136970
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.