Skip to content

Commit Data

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

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

| Option | Description | |--------|-------------| | --days <n> | Sync last N days (default: 90) | | --from <date> | Backfill from date (syncs all repos) | | --reset | Delete existing commits first | | --full | Reset and sync from 2024-01-01 | | --dry-run | Preview without writing to database | | --retry | Retry failed requests with backoff |

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

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 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

View sync state and statistics:

Terminal window
pnpm cli github:status

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

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

Remove merge commits that were incorrectly tracked:

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