Interview Insights · Git
Why Git Questions Reveal More Than Any Resume Line
Quick summary — Git as evidence
Git sits exactly where code meets other people, so Git questions expose how you really worked. Anyone can type 'Git, GitHub' into a skills list. But branching strategy, merge conflicts, commit messages and pull request reviews only happen when you work with others or at least work carefully. When I ask how you split work across branches or what your last conflict was, a real story comes out quickly with details. A copied or solo project produces vague, textbook answers. This page explains what each Git question is really checking and how to prepare honest, specific answers.
In this guide you will learn:
- Which Git questions interviewers use to test project claims
- How to explain merge vs rebase with a real reason, not a definition
- How to describe a merge conflict you actually resolved
- What your commit history says about you before you speak
- How to audit your own repo before the interview
SECTION 01What a Git question is really testing
When a resume says 'built an e-commerce app with a team of four', I cannot verify it by reading. So I ask a Git question about it. How did you divide the work? Did each person have a branch? Who merged into main? What happened when two people edited the same file?
These questions are hard to fake because the answers depend on lived moments: the day a conflict broke the build, the pull request that got rejected, the commit message someone complained about. A candidate who did the work answers with small, specific details. A candidate who did not usually answers with definitions.
| Git question | What it checks | Strong signal | Weak signal |
|---|---|---|---|
| How did your team use branches? | Real collaboration | Feature branches, PRs into main, who reviewed | We all pushed to main |
| Tell me about your last merge conflict | Hands-on experience | Which file, why it clashed, how you chose | Never had one |
| Show me your commit history | Working habits | Small commits with clear messages | One giant 'final' commit |
| Merge or rebase, which did you use? | Reasoning about history | A choice with a reason | A memorised definition only |
Q: How did your team of four use Git on this project?
A: We used Git and GitHub for version control.
Everyone pushed their code and we merged it.
Git is very useful for collaboration.
What I hear: no branch names, no review,
no conflict, no single concrete moment.Q: How did your team of four use Git on this project?
A: Each of us worked on a feature branch, like
feature/cart or feature/payment. We opened pull
requests into main and one other person had to
approve. Once, my cart branch and my friend's
coupon branch both changed cartTotal(), so we
had a conflict. We sat together, kept his discount
logic, and I rewrote my rounding on top of it.
The second answer is not more technical. It is more specific. Branch names, a function name and a decision about whose code to keep are all details that are easy to remember if you lived them and hard to invent on the spot.
SECTION 02Merge vs rebase: the answer that shows judgement
'What is the difference between merge and rebase?' is one of the most common Git questions. Most candidates give a definition. That is fine, but it does not reveal much. What I really want is your judgement: when would you use each, and why?
A merge joins two branches with a merge commit and keeps the true history of when work happened. A rebase replays your commits on top of another branch, which makes history linear but rewrites your commit IDs. Because rebase rewrites history, the usual team rule is simple: rebase your own local or feature branch to keep it up to date, but never rebase a branch others are already building on.
| Aspect | git merge | git rebase | When I would choose it |
|---|---|---|---|
| History shape | Keeps branches and adds a merge commit | Linear, as if work happened in sequence | Rebase for a clean feature branch |
| Commit IDs | Unchanged | Rewritten for replayed commits | Merge when others share the branch |
| Conflicts | Resolved once in the merge commit | May be resolved commit by commit | Merge for long-lived branches |
| Safety on shared branches | Safe | Risky, needs force push afterwards | Merge into main through a PR |
# Bring main's latest changes into my feature branch
git checkout feature/payment
git fetch origin
git merge origin/main
# resolve conflicts if any, then
git add .
git commit # completes the merge commit
git push origin feature/payment
# History now shows exactly when main was merged in.# Same goal, linear history, on MY branch only
git checkout feature/payment
git fetch origin
git rebase origin/main
# if a conflict stops the rebase:
# fix the file, then
git add src/payment.js
git rebase --continue
# or give up safely:
# git rebase --abort
# The branch was pushed before, so its IDs changed:
git push --force-with-lease origin feature/payment
A strong spoken answer sounds like this: 'On my project we merged pull requests into main, because main was shared. Before opening a PR, I rebased my feature branch on main so reviewers saw a clean set of commits.' One sentence of choice and one of reason.
SECTION 03Your commit history speaks before you do
Many interviewers open your GitHub link before the round. Within a minute they can see how you work. Are commits small and frequent, or is there one upload called 'final project'? Do messages explain what changed and why? Is there a .gitignore, or are node_modules and passwords in the repository?
None of this needs a long review. A short scan of the history is enough to form a first impression, and then the interview questions follow from what they saw. If your history has gaps, you can still fix the habits now and explain honestly in the interview.
| What I notice | Good sign | Warning sign | Quick fix for future work |
|---|---|---|---|
| Commit size | Each commit does one thing | Hundreds of files in one commit | Commit after each small working step |
| Messages | add email validation to signup form | update, changes, final, asdf | Use verb plus what plus where |
| Ignored files | .gitignore covers builds and env files | node_modules or .env committed | Add .gitignore before the first commit |
| Branches | Feature branches merged by PR | Everything on main from day one | Use a branch per feature, even solo |
# See your history the way an interviewer does
git log --oneline --graph --all -20
# How many commits did each author make?
git shortlog -sn
# Which files changed the most?
git log --name-only --pretty=format: | sort | uniq -c | sort -rn | head
# Did secrets ever get committed?
git log -p -S "API_KEY" --all# .gitignore for a typical Node project
node_modules/
dist/
.env
*.log
# If .env was committed by mistake:
git rm --cached .env
echo ".env" >> .gitignore
git commit -m "stop tracking .env file"
# Then rotate any key that was in it.
# Removing the file does not remove it from old commits.
Do not rewrite an old project's whole history just to look better. If someone asks why the early commits are messy, say so plainly: 'That was before I learned to commit in small steps. You can see the newer project is different.' Growth is a good story.
SECTION 04Prepare your Git evidence before the interview
Use these worksheets to turn each project on your resume into ready Git stories. Fill them in from memory first, then check your repository to confirm the details are correct.
PROJECT: ______________________
Team size and my role: ______________________
Branching approach we used: __________________
Who reviewed and merged PRs: _________________
One merge conflict I resolved:
File / function: ___________________________
Why it clashed: ____________________________
How we decided: ____________________________
One thing I would change in our Git workflow:
______________________________________________MY ONE-MINUTE ANSWER
Definition (one line each):
merge -> joins branches with a merge commit
rebase -> replays my commits on top of another
What we used on my project: __________________
Why: _________________________________________
My safety rule:
Never rebase a branch others have pulled.
After rebasing my own pushed branch,
push with --force-with-lease.BEFORE SHARING A GITHUB LINK
[ ] README says what it does and how to run it
[ ] .gitignore exists, no node_modules or build
[ ] No .env, keys or passwords in history
[ ] Recent commits have clear messages
[ ] At least one feature branch merged by PR
[ ] I can explain the last five commits
[ ] Repo name and description match the resume
Any box unchecked? Fix it or prepare
an honest one-line explanation.
SECTION 05Small habits that make your Git answers believable
Believable answers come from real habits. These are easy to start this week, even on solo projects.
- Use branches even alone — Create a branch for each feature and merge it with a pull request to yourself. You will have real branch and PR stories to tell.
- Write messages for a stranger — A commit message should tell someone who never saw the code what changed and why. Interviewers read them as a sample of your communication.
- Remember your conflicts — When you resolve a conflict, write one line about it in your notes. These small stories are gold in interviews and easy to forget.
- Review a friend's PR — Leave real review comments on a classmate's pull request. Then you can honestly answer questions about code reviews.
- Say 'I' for your part — In team stories, be clear about which branch, commit or decision was yours. 'We did everything' hides your contribution.
SECTION 06Interview Q&A — Git as evidence
Q1How did you use Git in your last project?
Give the workflow and one specific moment. For example: 'We used feature branches and pull requests into main, with one approval required. I handled the payment branch, and once I had a conflict with the coupon branch in the cart total function, which we resolved by keeping the discount logic and moving my rounding after it.'
Q2What is the difference between merge and rebase?
Merge joins two branches with a merge commit and keeps the true order of events. Rebase replays my commits on top of another branch, giving a linear history but rewriting commit IDs. I rebase my own feature branch to keep it current and use merges, usually through pull requests, for shared branches like main.
Q3How do you resolve a merge conflict?
I run git status to see the conflicted files, open each one and read both sides between the conflict markers. I decide what the combined code should be, often by talking to the other developer, remove the markers, run the tests, then git add the file and complete the merge or continue the rebase.
Q4What makes a good commit message?
A short summary line in the imperative, such as 'add email validation to signup form', that says what changed. If the reason is not obvious, a body explains why. Each commit should do one logical thing, so the message can describe it clearly.
Q5Why should you not commit node_modules or .env files?
node_modules can be rebuilt from package.json and package-lock.json, so committing it just bloats the repository. .env files usually contain secrets, and once committed they stay in history even if deleted later. Both belong in .gitignore, and any leaked secret should be rotated.
SECTION 07Test yourself — Git as evidence quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
What Git questions are asked in interviews for freshers?
Expect questions on merge versus rebase, resolving merge conflicts, git stash, reset versus revert, branching in a team and writing good commit messages. Many interviewers also ask you to describe how your project team used Git.
Do interviewers really check my GitHub profile?
Many do, especially for fresher roles where projects are the main evidence. They usually look at the README, the commit history and whether the code matches what the resume says, rather than reading every file.
Should I use merge or rebase in my projects?
Both are fine. A common practice is to rebase your own feature branch on main to keep it current, and merge into main through pull requests. The important part is never rebasing a branch that others are using.
How do I show Git experience if I worked alone?
Use feature branches and pull requests even on solo projects, write clear commit messages, and contribute to a classmate's or open-source repository. Then describe that work honestly as individual practice.
Is it bad to have one big commit in my GitHub project?
It is a weak signal because it hides how you built the project and can look like an upload of copied code. For future projects, commit after each small working step. For old ones, be ready to explain honestly.
Where can I practise Git interview questions with expert feedback?
Yes. Uncodemy's DevOps Training Course in Noida (classroom and online) includes live projects, one-to-one mock interviews and resume reviews, so you practise Git interview questions with trainer feedback before the real interview. You can book a free demo class from this page to see how the sessions work.
SECTION 09Related reads
Classroom & online · Noida
Build Git stories you can tell with confidence
Our DevOps Training Course puts you in team-style projects with branches, pull requests and reviews, so your Git answers come from real practice.
Talk to a counsellor for current fees- Team repository projects
- Pull request reviews
- CI/CD with Git triggers
- Weekday & weekend batches