我不知道为什么,但我的 Visual Studio Code 显示错误的提交作者姓名。我正在尝试更改提交的作者。我怎样才能做到这一点?我已经有很多东西了,但没有运气。
这是我尝试过的:
由于我有三个提交,所以我尝试了git rebase -i HEAD~3
,
但我收到此错误:
无法变基:您有未暂存的更改。请提交或隐藏它们。
I am able to get to this now, how can i change the author name now?
对于这个问题: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.
请注意,如果前 3 次提交包含您已隐藏的文件,则可能会发生冲突。
For the 错误的提交作者姓名使用您的终端cd
进入项目目录并使用
git config user.name // Check your user name
git config user.email // Check the associated email
如果该信息不是您想要的信息,您可以使用更新它
git config --global user.name "newemail"
git config --global user.email "[email protected] /cdn-cgi/l/email-protection"
注意:以上内容将是全局更改,这意味着它将针对所有内容进行更改git
项目。如果您只想为一个项目更改它:
git config user.name "newemail"
git config user.email "[email protected] /cdn-cgi/l/email-protection"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)