Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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: enter image description here

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

like image 845
Daniel Stephens Avatar asked Mar 29 '20 03:03

Daniel Stephens


People also ask

How do I show the author name in Visual Studio?

To show this option you can press (Alt + 5) key, by opening the changes window you can see the detail of changes with change set ID, Change set Description, Author Name and Date of Changes.

How do I change the author name in Git Visual Studio?

Change your display info through Team Explorer > Settings > Repository Settings . EDIT: Just noticed you're talking about existing commits, take a look at Change commit author at one specific commit. Addition: If you want to set user.name for a repo you probably want to set user. email as well.

How do I give Git credentials in Visual Studio?

Steps to add git credentials in vs code Step 1: Download git from the official website https://git-scm.com and install it. Step 2: When you're finished installing Git, start Visual Studio Code and verify that Git is now identified. Step 3: Start a new Terminal and configure your 'user.name' and 'user.

How do I get the Git menu in Visual Studio 2019?

Adding the GIT menu in VS 2019 Community Edition We will open Visual Studio 2019 Community Edition and select “Extensions-> Manage Extensions” from the top menu. Then, select “Online-> Visual Studio Marketplace” and search for “GIT”.


3 Answers

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 Blame(Annotate)

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

Visual Studio annotations

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

like image 194
JeremyTCD Avatar answered Oct 23 '22 08:10

JeremyTCD


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.

like image 24
Allen Tellez Avatar answered Oct 23 '22 08:10

Allen Tellez


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. Source Control Settings

like image 2
Dover8 Avatar answered Oct 23 '22 10:10

Dover8