Visual studio,修改者的昵称

Visual studio, nickname of the person who made the change

我正在与一些人一起工作,共享同一个 Github 存储库。我们决定我们想知道谁制作了哪个脚本或轻松编辑了一些代码行。最好的方法是在代码旁边写上进行更改的人的姓名首字母。我知道在 Rider 中这是可能的,因为我在某家公司工作时看到了这一点。我认为这是与 Github 的某种合作。有人知道如何在 VS 2019 中添加这样的东西吗?

如果您正在使用 Github,那么您希望将 Git 用作配置管理工具。这样,您团队中的每个成员都可以从 Git 中心检索内容,并通过 Git 命令推送更新。 当您第一次设置您的工作环境时,您配置您的姓名和电子邮件地址。然后可以使用这些信息来识别谁在 Github 中进行了每个更改。 在此处阅读基本设置:https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup

Your Identity The first thing you should do when you install Git is to set your user name and email address. This is important because every Git commit uses this information, and it’s immutably baked into the commits you start creating:

$ git config --global user.name "John Doe"

$ git config --global user.email johndoe@example.com

编辑:

抱歉,我确实没听懂你的问题。这里也有人问过同样的事情:

我要补充一点,您正在寻找的是 git blame 命令的演示文稿,它显示了谁修改了哪一行。您可以通过右键单击源 file/Source Control/Annotate 在 Visual Studio 中访问它。这不如 CodeLens 实用,因为您必须单击几次,但可以完成工作。