【问题标题】:Change Git Author Information in Visual Studio在 Visual Studio 中更改 Git 作者信息
【发布时间】:2017-03-27 14:28:44
【问题描述】:

我在 Visual Studio Team Services 中有一个团队项目,我使用 git 作为版本控制系统。

是否可以在 Visual Studio 网站中更改提交的作者姓名和电子邮件?

【问题讨论】:

  • 说到纯git,答案是“是”。如果修改很多,你可以考虑使用 git filter-branch 来做。如果只是一些修订,您可能会考虑修改它们(并挑选它们之上的任何内容)。 git-scm.com/book/en/v2/Git-Tools-Rewriting-History
  • 我知道如何为本地 git 项目做到这一点。但我想在 visualstudio.com 中进行,因为我的项目托管在那里。我在网站上找不到任何更改作者信息的选项。
  • 无法在本地进行更改,然后使用git push -f 强制您在本地拥有的任何内容来替换远程内容?
  • @Edmundo 成功了。谢谢!

标签: git visual-studio azure-devops git-filter-branch


【解决方案1】:

您的作者姓名和电子邮件地址与您的提交绑定,并且大部分来自您的全局 Git 设置,而不是您的 VSTS 帐户。通过Team Explorer > Settings > Repository Settings更改您的显示信息。


如果你想通过 Git shell 改变它:

要为特定存储库设置用户名,请在存储库的根文件夹中输入以下命令:

git config user.name "Billy Everyteen"
# Set a new name
git config user.name
# Verify the setting
Billy Everyteen

Source


编辑:刚刚注意到您在谈论现有提交,请查看Change commit author at one specific commit

【讨论】:

  • 补充:如果你想为 repo 设置user.name,你可能也想设置user.email
猜你喜欢
  • 2020-07-09
  • 2017-07-08
  • 2022-07-12
  • 2015-08-23
  • 1970-01-01
  • 2019-01-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多