Interview Prep/Git & GitHub/Recovery and incident handling

How do you find who or what pushed a specific commit to a protected branch?

AdvancedProductionRecovery and incident handling
Answer

Combine git log --format='%H %an %cn' with the audit log and the PR that merged it (gh pr list --search <sha> --state merged). Merge commits show the committer as GitHub for web merges. The audit log shows pushes, bypasses and force-pushes with actor and time.

gh pr list --search "<sha>" --state merged --json number,author,mergedBy
All Git & GitHub questions Roadmap: Git & GitHub

More on Recovery and incident handling