Skip to main content

Export the log of all commit messages between two specific dates

#!/bin/bash

# Set the start and end dates
start_date="2022-01-01"
end_date="2022-12-31"

# Set the specific committer's email address
committer_email="example@example.com"

# Get the list of commits by the specific committer between the two dates
commit_list=$(git log --pretty=format:"%h %s" --author="$committer_email" --since="$start_date" --until="$end_date")

# Export the commit messages to a txt file
echo "$commit_list" > commit_messages.txt

echo "Commit messages by $committer_email exported to commit_messages.txt"