![]() ![]() Now, once we hover over the git blame message, we will get more details of the commit. Once more we have to allow access from VS Code.įinally, we get access. Next, GitHub will ask us to give permission in our browser.Īgain GitHub will ask for permission to open VS Code. Notice that the first time we use it, it will also ask us to Connect to GitHub.Īfter clicking on Connect to GitHub, we will get a pop-up. When we hover our mouse over the gray text, we will get more information. It will show the author name with commit message and time in light gray text. The basic way to use GitLens is to click on the line of code for which you need to know the author. ![]() It has some basic features for all users and also advanced features for power users. This extension provides many ways to see the git blame. This extension is created by GitKraken, and the full name is “GitLens - Git supercharged.” Again we will search for “git blame” in the Extension tab, and GitLens is the second one. In fact, it is the most popular extension in VS Code with 17 million downloads. GitLens is the most popular extension for git blame. This will open the GitHub changes in the browser, with commit details. It will also have a View button, so let’s click on it. Next, we will click on the author name in the blue strip at the bottom.Ĭlicking the name will open a pop-up showing the git commit message. Here we have clicked on another line and found it was done by another author. And we will also see at what time the commit was done. We clicked on line 11 and in the bottom strip we will see the author of that line. To illustrate what this looks like, we have opened the same Community.js file, which we have checked from the terminal. Now we can open any file and click on any line. We don’t need to do any other configurations to use this extension. Once installed successfully, we will see the Disable and Uninstall buttons. After that, click on the Install button to install this extension in your VS Code. We will get a lot of extensions, but click on the first one, which is Git Blame by Wade Anderson and has 1.3 million downloads. Here, search for “blame” in the input box and press Enter. After that, we need to click on the Extension tab in the left strip. You can open any project, but it will be useful if the code has multiple authors. We have opened our earlier project in VS Code. We will look at the below extensions to add git blame to our project: These extensions are generally small programs that add functionalities in VS Code. Now, most extensions in VS Code are free to use like VS Code itself. Instead, we can use four extensions in VS Code, which will help us find the author of each line of code easily. VS Code Git Blame ExtensionsĪs we just saw, it is a lot of work to manually check the author in each file through the command line. In the next section, we are going to look into better ways to do this through VS Code extensions. ![]() So, it will be very difficult to check the different authors in each file through the command line. The above project is a large React.js project with many files. We can also see that almost all changes were done by a user called ankit, but the change on line 16 was made by user nabendu82. Here, the author of each line is mentioned. Notice that we have to give the complete path and also the filename. In the below example, we are using git blame to find the changes done in a file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |