visual-studio - 如何更改 visual code studio 提交作者

标签 visual-studio github git-commit

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

这是我尝试过的:

因为我有三个提交,所以我尝试了 git rebase -i HEAD~3, 但我收到此错误:

Cannot rebase: You have unstaged changes. Please commit or stash them.

我现在可以做到这一点,我现在如何更改作者姓名? enter image description here

最佳答案

对于问题:无法 rebase :您有未暂存的更改。请提交或隐藏它们。 你可以做到

git stash // To stash the changes
git rebase -i HEAD~3 // To Rebase
git stash pop // To pop the stashed changes. 

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

对于错误的提交作者姓名 使用您的终端 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 "newemail@example.com"

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

git config user.name "newemail"
git config user.email "newemail@example.com"

关于visual-studio - 如何更改 visual code studio 提交作者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49123470/

相关文章:

sql-server - SQL Server 未显示在 Visual Studio 中

github - 如何将 Xcode Swift Playground 导入 GitHub?

github - 添加 SSH key 后,Github 上的身份验证失败

git - 工作目录和 git 索引有什么区别?

email - 获取提交者电子邮件

git - 如何删除对 git 的提交

c++ - 如何在 Visual Studio 汇编程序输出中分解名称?

.net - 无法在控制台应用程序中引用 System.Web

.net - Silverlight 开发入门

RStudio README.Rmd 和 README.md 都应该使用 'git commit --no-verify' 来覆盖这个检查