简体   繁体   中英

Git author information in Visual Studio 2019

I use Visual Studio 2019 and I am missing a feature I can't find in the settings. In Visual Studio Code , once I open a project that is under git control, I see an author and commit info of the line the text cursor is currently located in. If I open the same project in Visual Studio 2019 this functionality does not appear.

I am looking for the info between line 8-9: 在此处输入图片说明

Is there any option to active that feature from VS Code in VS 2019 as well? Any help is highly appreciated!

If you want source control history at the method level, enable CodeLens . Note that the 2019 community version of Visual Studio does not include this feature.

If you want source control history at the per-line level, in your text editor, right click > Source Control > Blame (Annotate):

Visual Studio 责备(注释)

Author and commit ( git blame ) info will be displayed for each line:

Visual Studio 注释

For quicker access, add a shortcut for the command "Team.Git.Annotate".

In Visual Studio Professional 2019 using GIT as source control you should be able to right click in the file and select Git > Blame(Annotated) to view line annotations with author, date and a unique commit identifier.

Clicking the commit id will bring up the change set so you can review all of the changes associated with the line(s) in question as well as any comments for the commit.

It threw me off because a person might think to right click in the file and select Annotation > Show Line Annotations which did not seem to work for me.

I was recently checking out other Source Control options (Perforce and Plastic SCM), and then noticed I too had lost my Git ▸ Blame option in VS. Turned out the Plug-in Selection was no longer set to Git, so make sure it is on inside of Tools ▸ Options. 源代码管理设置

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM