如何更改 Visual Code Studio 提交作者

Enc*_*oul 2 github visual-studio git-commit

我不知道为什么,但我的 Visual Studio Code 显示了错误的提交作者姓名。我正在尝试更改提交的作者。我怎样才能做到这一点?我已经有很多东西了,但没有运气。

这是我尝试过的:

由于我有 3 次提交,我尝试过git rebase -i HEAD~3,但出现此错误:

无法变基:您有未暂存的更改。请提交或隐藏它们。

我现在能够做到这一点,我现在如何更改作者姓名? 在此处输入图片说明

mys*_*dad 5

对于这个问题:Cannot rebase: You have unstaged changes. Please commit or stash them.你可以做

git stash // To stash the changes
git rebase -i HEAD~3 // To Rebase
git stash pop // To pop the stashed changes. 
Run Code Online (Sandbox Code Playgroud)

请注意,如果前 3 次提交包含您存储的文件,您可能会遇到冲突。

对于错误的提交作者姓名 使用您的终端cd进入项目目录并使用

git config user.name // Check your user name
git config user.email // Check the associated email
Run Code Online (Sandbox Code Playgroud)

如果信息不是您想要的信息,您可以使用更新它

git config --global user.name "newemail"
git config --global user.email "newemail@example.com"
Run Code Online (Sandbox Code Playgroud)

注意:以上将是全局更改,这意味着它将针对所有git项目进行更改。如果您只想为一个项目更改它:

git config user.name "newemail"
git config user.email "newemail@example.com"
Run Code Online (Sandbox Code Playgroud)