---
title: "Counting Commits by Author per Day with Git"
date: 2021-07-16T17:09:57.000Z
author: Z.SHINCHVEN
tags: [Git, Developer Tools, Version Control]
canonical: https://atlassc.net/2021/07/17/counting-on-git
---
## Introduction

In the world of Git, sometimes it becomes necessary to know the contributions of each author over a period of time. This can help in gauging productivity, contributions, or even pinpointing when the most commits were made by a particular author. Here, I will share some simple Git commands that you can run to count commits by an author per day.

## Counting Commits

### Basic Command

The most straightforward way to count commits by an author per day is by using the following command:

```bash
# This command counts the number of commits by a given author
# and groups them by date.
git log --author="<AUTHOR_NAME>" | grep Date | awk '{print ": "$4" "$3" "$6}' | uniq -c
```

### Adding a Date Range

If you are interested in counting commits within a specific date range, use this command:

```bash
# This command filters the commits by date and then counts them.
git log --author="<AUTHOR_NAME>" --before="<BEFORE_DATE>" --after="<AFTER_DATE>" | grep Date | awk '{print ": "$4" "$3" "$6}' | uniq -c
```

### Example

Here's an example command that counts the number of commits made by an author named "my name" between November 10, 2020, and June 30, 2021:

```bash
# Example usage with a specific author and date range
git log --author="my name" --before="2021-06-30" --after="2020-11-10" | grep Date | awk '{print ": "$4" "$3" "$6}' | uniq -c
```

## Conclusion

By using these simple Git commands, you can easily find out how many commits were made by a particular author and on which days. This can be a helpful metric for many use-cases, such as auditing or evaluating the contributions of team members.
