问题描述
我的 Git 提交的用户已更改,但我无法在 Visual Studio Code 中更改该用户.
The user for my Git commits has changed, but I am not able to change that inside of Visual Studio Code.
我更改了 Git 中的全局设置,但是当我想在我的新存储库中通过 Visual Studio Code 推送或同步时,我收到错误消息,指出 oldusername 没有推送到 新存储库.
I changed the global settings in Git, but when I want to push or sync via Visual Studio Code inside my new repositories I get the error that the oldusername has not the permission to push into newrepository.
此时不是权限.用户名的更改不适用于 Visual Studio Code.当我使用终端时,我可以推送.这也不是允许 olduser 推送到 newrepository 的解决方案.
At this point it is not the permission. The change of the username did not work for Visual Studio Code. When I use the terminal I can push. It is also not a solution to allow the olduser to push to the newrepository.
我使用的是 Windows 10.所以所有其他工具都可以使用,但仅在 Visual Studio Code 中我无法更改用户.
I am on Windows 10. So all other tools are working, but just at Visual Studio Code I was not able to change the user.
我该如何解决这个问题?
How can I fix this problem?
推荐答案
我通过在 Git 中设置电子邮件地址解决了这个问题:
I resolved this issue by setting an email address in Git:
git config --global user.email "[email protected]"
这篇关于在 Visual Studio Code 中更改 Git 用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!