⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ 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) →
← Back to All Git & Branching Workflows Interview Questions Scenario 50 of 52 in Git & Branching Workflows
Staff SRE / Principal Architect [L3] Git Determine affected services based on changed paths Staff SRE Scenario [L3]
🎯 Target Role / Context: Git Scenario #50 (L3) · Determine affected services based on changed paths

Q: A developer reports that `git push` is extremely slow (takes 5+ minutes) even for small commits. The repo itself is only 500 MB. How do you diagnose and fix this?

Slow pushes with small changesets typically aren't about bandwidth — the bottleneck is usually pack negotiation or server-side processing.

#Git #L3 #Version Control #Collaboration
🎙️ Candidate Opening & Architectural Context
""When an engineer accidentally creates this branch or commit divergence, I walk them through safe recovery without data loss. The interviewer is testing: Debugging Git performance, understanding pack negotiation, and server-side issues.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's Advanced Git Workflows, Rebase & Interactive Diagnostics covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: "When an engineer accidentally creates this branch or commit divergence, I walk them through safe recovery without data loss. The interviewer is testing: Debugging Git performance, understanding pack negotiation, and server-side issues.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."

1️⃣

Initial Diagnostics & Root Cause Analysis

Slow pushes with small changesets typically aren't about bandwidth — the bottleneck is usually pack negotiation or server-side processing.

  • Enable Git tracing:
  • Check where time is spent:
  • "Counting objects" / "Compressing objects" takes minutes? — the local repo has too many loose objects or a bloated object database. Run git gc and git repack -a -d --depth=250 --window=250.
  • Negotiation phase is slow? — Git exchanges "have/want" lists with the server. With many branches and tags, this can be large. Prune stale remote refs: git remote prune origin. Delete merged branches.
  • Server-side hooks are slow? — pre-receive or update hooks (code scanning, large file checks, CI triggers) run synchronously. Check with the platform admin.
  • Network latency? — curl -o /dev/null -w "time_connect: %{time_connect}\ntime_total: %{time_total}\n" to check.
  • Check for large files in recent commits:
2️⃣

Remediation & Permanent Safeguards

Diagnosis: This shows every step: DNS resolution, TLS handshake, ref advertisement, pack negotiation, and upload. A single large blob forces a big packfile upload. Fixes: If the root cause is many stale refs, regularly run git fetch --prune and delete merged feature branches both locally and remotely.

GIT_TRACE=1 GIT_TRANSFER_TRACE=1 GIT_CURL_VERBOSE=1 git push origin main
  • Run git gc --aggressive if the local object store is fragmented.
  • Enable push.negotiate (Git 2.36+): git config push.negotiate true — uses a more efficient negotiation algorithm.
  • Use SSH instead of HTTPS if TLS overhead is contributing.
  • Push only the branch you need: git push origin main instead of git push --all.
  • Consider --thin (default) — verify it's not disabled. Thin packs send deltas against objects the server already has, reducing transfer size.
  • Check for server-side quotas or throttling — some Git hosting providers rate-limit pushes or run expensive server-side operations.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Enable Git tracing:."
⚡ 60-Second Elevator Pitch Talking Points
  • Enable Git tracing:
  • Check where time is spent:
  • "Counting objects" / "Compressing objects" takes minutes? — the local repo has too many loose obj...
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Running raw git push --force rather than git push --force-with-lease on shared team feature branches when configuring developer reports push git push --force unconditionally overwrites remote commits made by teammates, whereas --force-with-lease aborts if the remote ref was updated.
  2. Resolving complex merge conflicts with blind checkout overwrite strategies without running unit tests when configuring developer reports push Unilateral conflict resolution frequently clobbers complementary logic introduced in parallel feature branches, creating regression bugs.
  3. Discarding corrupted working directories prematurely instead of recovering lost state using git reflog when configuring developer reports push git reflog tracks every HEAD movement, allowing instant recovery of discarded commits, botched rebases, or deleted local branches.
  4. Disabling branch protection rules and mandatory PR approval reviews on shared release branches when configuring developer reports push Without branch protection, developers can bypass CI validation gates and push untested code directly to production branches.
Advertisement
Want more Git & Branching Workflows scenarios?
Explore our complete collection of scenario-based Git & Branching Workflows interview runbooks.
Browse All Git & Branching Workflows Questions →