Skip to content

Instantly share code, notes, and snippets.

@jasperf
Last active May 2, 2026 00:56
Show Gist options
  • Select an option

  • Save jasperf/ab0d75ab74c74d6612643e367649dd11 to your computer and use it in GitHub Desktop.

Select an option

Save jasperf/ab0d75ab74c74d6612643e367649dd11 to your computer and use it in GitHub Desktop.
Get work summaries using Git for working out hours worked in a specific repository

Work Summary Tools

Daily Work Summary Script

Use this git command to generate a summary of work done for any given day:

# Get today's commits summary
git log --since="$(date +%Y-%m-%d) 00:00:00" --until="$(date +%Y-%m-%d) 23:59:59" --oneline --author="$(git config user.name)"

# Get detailed stats for today's commits
git log --since="$(date +%Y-%m-%d) 00:00:00" --until="$(date +%Y-%m-%d) 23:59:59" --stat --author="$(git config user.name)"

# Get first and last commit times to estimate work hours
echo "First commit:" && git log --since="$(date +%Y-%m-%d) 00:00:00" --until="$(date +%Y-%m-%d) 23:59:59" --format="%ai %s" --author="$(git config user.name)" | tail -1
echo "Last commit:" && git log --since="$(date +%Y-%m-%d) 00:00:00" --until="$(date +%Y-%m-%d) 23:59:59" --format="%ai %s" --author="$(git config user.name)" | head -1

Custom Date Range

For specific dates, replace $(date +%Y-%m-%d) with the desired date in YYYY-MM-DD format:

# Example for September 5, 2025
git log --since="2025-09-05 00:00:00" --until="2025-09-05 23:59:59" --oneline --author="$(git config user.name)"

Work Summary Template

When generating work summaries, use this template:

## Work Summary - [Date]

**Estimated Hours Worked**: [Start Time] - [End Time] ([Duration])

### Major Tasks Completed:

**1. Task Name ([Time])**
- Description of work done
- Files/features modified
- Version updates

**2. Task Name ([Time])**
- Description of work done
- Files/features modified

### Files Modified:
- **Category**: file1, file2, file3
- **Category**: file4, file5

### Pull Requests Merged: [Number]
Brief description of workflow approach.

**Current Theme Version**: [Version]

Usage Notes

  • The script uses git config user.name to filter commits by author
  • Times are shown in the repository's configured timezone
  • Use git log --help for additional formatting options
  • Consider using --no-merges flag to exclude merge commits if needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment