Git

How to view a Git Log of Just One User’s Commits?

Git is mainly utilized for large team projects. It enables all users to view the project log status for getting an updated version of add changes in the project source code files. Developers can also get the list of user commits with details for managing the project. The “$ git log –authors=<user-name>” command can be used for this purpose.

This write-up discusses the method of viewing the Git log of just one user’s commits.

How to View a Git Log of Just One User’s Commits?

To view a Git log of a particular user’s commits, try out the below-listed instructions:

  • Go to the Git root directory.
  • Check the list of all users.
  • Run the “$ git log” command along with the “–authors” parameter and its value.

Now, move ahead and partially perform the above-given steps for better understanding.

Step 1: Move to Root Directory

The first and foremost thing is to navigate to the Git root directory by running the provided command:

$ cd "C:\Users\nazma\Git"

Step 2: View Users List

Now, execute the “git shortlog” command with the “-nse” option to view author names with commit count:

$ git shortlog -nse

Step 3: Get Particular User’s Commit Git Log

To get the particular user’s commit Git log, run the “git log” command with the “–author” parameter and its value:

$ git log --author=Maria

Here, “Maria” is one of our Git usernames:

As you can see, the list of Git logs against this specified user is displayed.

Conclusion

To view a Git log of a particular user’s commits, move to the Git root directory and check the list of users by executing the “$ git shortlog -nse” command. Then, run the “$ git log” command along with the “–authors” parameter and its value. This write-up demonstrated the method of viewing the Git log of just one user’s commits.

About the author

Sharqa Hameed

I am a Linux enthusiast, I love to read Every Linux blog on the internet. I hold masters degree in computer science and am passionate about learning and teaching.