Your First Commit Is a Promise, Not a Save
Q: You've been assigned a new ticket. Walk me through your thought process from the moment you start, specifically how you create a branch and make your first commit.
Why this matters: This is the most fundamental workflow in all of software. It's a test of your discipline, your communication habits, and your respect for the team's shared codebase. A bad answer signals you're a risk.
Interview frequency: Guaranteed. This is the engineering equivalent of "tell me about yourself."
❌ The Death Trap
The candidate narrates the clicks. They describe the UI of Azure Repos or the commands in Git without any underlying philosophy. They explain the 'what' but completely miss the 'why'.
"Most people say: 'First, I'd go to the repo and click on the master branch dropdown, then 'New Branch.' I'd give it a name, maybe based on the ticket. Then I'd edit the file I need to change. After I'm done, I'd commit it with a message like 'updated file.'"
This is the answer of a robot. It shows you can follow instructions, but it doesn't show you can think. The commit message "updated file" is a cardinal sin.
🔄 The Reframe
What they're really asking: "How do you create a safe, isolated environment to solve a problem, and how do you document your solution for the permanent historical record of the project?"
This reveals you understand that branching is about risk management, and committing is an act of communication. It's not about saving your work; it's about making a clear, well-reasoned entry into the project's official ledger.
🧠 The Mental Model
I follow a simple two-step philosophy: **"Build the Sanctuary, then Act as the Scribe."**
📖 The War Story
Situation: "Early in my career, there was a production outage. A critical payment API was failing. The pressure was on to get a hotfix out immediately."
Challenge: "An eager junior engineer, trying to be a hero, jumped directly onto the `master` branch, made a quick code change, and committed it with the message 'fix'."
Stakes: "The 'fix' had a typo. Because he worked on `master`, our CI/CD pipeline immediately picked it up and deployed the broken code to production. He had turned a fire into an inferno. The site was down for another hour while we reverted his change."
✅ The Answer
My Thinking Process:
"That incident burned a lesson into my mind: the `master` branch is sacred. It's not just code; it's a promise to our users that this version works. My first responsibility when starting any work, no matter how small, is to protect that promise."
What I Did:
1. Build the Sanctuary: "Let's say I'm assigned ticket #451, 'Fix user profile image upload.' The first thing I do is create my sanctuary. In Azure Repos, I'll navigate to the branches view, click 'New Branch', and I won't just call it 'my-branch'. I'll give it a meaningful name that communicates intent, like feature/451-profile-image-upload. This name is a piece of documentation in itself. It tells everyone what this branch is for (a feature), what it's about (profile image upload), and its context (ticket #451). This act of naming is the first step in clear communication."
2. Act as the Scribe: "After I've made my initial, self-contained change, I prepare to make my first commit. This is the most critical step. I don't see it as saving my work; I see it as making a promise. My commit message is that promise. It will be structured and clear. For example:
feat: Add initial API endpoint for image upload
This commit introduces a new POST endpoint at /api/users/avatar. It accepts multipart/form-data and lays the groundwork for the image processing logic. This addresses the backend portion of ticket #451.
"This message isn't for me today. It's for my teammate tomorrow, or for me in six months when I have to figure out why this code exists. It turns a cryptic line in the `git log` into a valuable piece of historical documentation."
The Outcome:
"By following this two-step process, my work is always isolated, safe, and self-documenting from the very first line of code. It prevents the kind of disaster I witnessed. It means anyone on the team can look at my branch name and my commit history and understand the 'what' and the 'why' without ever having to ask me. It scales knowledge and reduces communication overhead."
What I Learned:
"I learned that branching and committing aren't clerical tasks. They are the fundamental rituals of professional software development. A good branch name is an act of consideration for your team. A good commit message is an act of kindness to your future self."
🎯 The Memorable Hook
"A branch is a license to be wrong in private. A commit is a claim to be right in public. Treat that claim with the seriousness it deserves."
This framing elevates the discussion from simple commands to the intellectual and social contracts that underpin teamwork. It shows you understand the weight and responsibility of adding your work to the collective effort.
💭 Inevitable Follow-ups
Q: "What about pull requests? Where do they fit in?"
Be ready: "A pull request is the bridge from my sanctuary back to the sacred `master` branch. It's a formal proposal that says, 'I believe the work in this sanctuary is complete, correct, and ready to become part of our shared promise to users.' It's the peer review process for our code."
Q: "How often do you commit?"
Be ready: "I commit as soon as I've completed a single, logical unit of work. A commit should be atomic—the smallest possible change that leaves the code in a better, coherent state. It might be fixing one bug, adding one function, or refactoring one module. Small, frequent commits are easier to review, understand, and, if necessary, revert."
