⚡ ~/naveed Interview Prep
⚡ Portfolio Home ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 998+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
Senior DevOps / SRE [L2] Git resolve conflicts, then: Production Scenario [L2]

Q: What is `.mailmap` and when would you use it?

.mailmap is a file that maps different author names and emails to a canonical identity. It fixes inconsistencies in git log, git shortlog...

#Git #resolve conflicts, then: #L2 #Version Control #Collaboration
🎙️ Candidate Opening & Architectural Context
""During a major release branch cut, we encountered this exact scenario and used Git internals to recover cleanly. The interviewer is testing: Awareness of author normalization in Git history.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement

🛠️ Production Runbook & Step-by-Step Resolution

1️⃣

Initial Diagnostics & Root Cause Analysis

.mailmap is a file that maps different author names and emails to a canonical identity. It fixes inconsistencies in git log, git shortlog, and git blame without rewriting history.

  • Open-source projects where contributors use different emails (work vs personal).
  • Post-acquisition consolidation (merging email domains).
  • Correcting typos in historical author names.
2️⃣

Remediation & Permanent Safeguards

The problem: over time, the same person commits with different identities: The solution — .mailmap in the repo root: Format: Canonical Name [Original Name] After adding this file, git shortlog -sne and git log --format='%aN' consolidate all entries under the canonical identity. git blame also uses it. Use cases: The .mailmap file should be committed to the repo. It doesn't change any commit objects — it's a display-time mapping only. --- ## 🔶 Git Configuration & Optimization

Alice Smith <alice@company.com>
Alice <alice@personal.com>
A. Smith <asmith@oldcompany.com>
  • git shortlog -sne for accurate contribution statistics.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Open-source projects where contributors use different emails (work vs personal).."
⚡ 60-Second Elevator Pitch Talking Points
  • Open-source projects where contributors use different emails (work vs personal).
  • Post-acquisition consolidation (merging email domains).
  • Correcting typos in historical author names.
Advertisement
Want more Git scenarios?
Explore our complete collection of scenario-based Git interview runbooks.
Browse All Git Questions →

📚 Related Production Scenarios in Git