Skip to content

Commit Data

Sync AI-attributed commits from GitHub by detecting Co-Authored-By headers.

Sync Commits

Sync commits from a specific repository:

Terminal window
# Sync last 90 days (default)
pnpm cli github:sync getsentry/sentry
# Sync last 30 days
pnpm cli github:sync getsentry/sentry --days 30

Sync Options

OptionDescription
--days <n>Sync last N days (default: 90)
--from <date>Backfill from date (syncs all repos)
--resetDelete existing commits first
--fullReset and sync from 2024-01-01
--dry-runPreview without writing to database
--retryRetry failed requests with backoff

Full Reset

To completely rebuild commit data:

Terminal window
# Reset and backfill from a specific date
pnpm cli github:sync --reset --from 2024-01-01
# Shorthand for the above
pnpm cli github:sync --full

Dry Run

Test detection without writing to the database:

Terminal window
pnpm cli github:sync getsentry/sentry --dry-run

Useful for verifying your GitHub App setup.

Backfill All Repositories

Backfill historical commits across all repos the GitHub App can access:

Terminal window
pnpm cli backfill github --from 2024-10-01

Mark backfill complete:

Terminal window
pnpm cli backfill:complete github

Check Sync Status

View sync state and statistics:

Terminal window
pnpm cli github:status

Debug Commits

Inspect commits stored in the database:

Terminal window
# Show recent commits for a repo
pnpm cli github:commits getsentry/sentry
# Limit results
pnpm cli github:commits getsentry/sentry --limit 50

User Identity Mapping

Map GitHub usernames to work emails:

Terminal window
# List users and their mapping status
pnpm cli github:users
# Sync emails from GitHub org (requires GraphQL access)
pnpm cli github:users:sync
# Manually map a user
pnpm cli github:users:map 12345678 user@company.com

Cleanup

Remove merge commits that were incorrectly tracked:

Terminal window
# Dry run
pnpm cli github:cleanup-merges --dry-run
# Execute
pnpm cli github:cleanup-merges