#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Interview Insights · Git

Why a Weak Git Answer Doesn't Always Mean Rejection

You blanked on git stash or cherry-pick and spent the rest of the round sure you had failed. Often you had not. Here is how I actually weigh a shaky Git answer, and what you can do in the next two minutes to turn it around.

Tracks
After a Weak Git Answer Interactive
The slip
—
Where the answer went
Next move
—
What the candidate does
Final read
—
How I score it
Slip→Admit→Reason→Recover
Click a reaction to see how the same Git slip is scored differently depending on what the candidate does next.

Home / Tutorials / Career Guides / Why a Weak Git Answer Doesn't Always Mean Rejection

Interview Insights · Git

Why a Weak Git Answer Doesn't Always Mean Rejection

TOPICREACTIONREST OF ROUNDDECISIONCore or extra?commit, branchor cherry-pickWeightWhat you doAdmit and reasonor bluffSignalOther answersProject depthCoding, clarityBalanceOverall viewTeachable gapor real riskOutcome
One weak answer is one data point. I weigh the topic, how you react, what you show elsewhere, and then the overall picture.

Quick summary — Recovering on Git

I rarely reject anyone for one weak Git answer. I reject for weak basics plus a poor reaction. Git has a small core that every developer uses daily and a long tail of commands people look up when needed. Forgetting a tail command like cherry-pick or bisect is a small gap. Not understanding what a branch or commit is, is a bigger one. What matters even more is how you react. Admitting the gap and reasoning from what you know often scores better than a confident wrong answer. This page shows how to tell the two kinds of gap apart and how to recover in the moment.

In this guide you will learn:

  1. Which Git topics are core and which are nice to have
  2. How interviewers score a weak answer in context
  3. A recovery script for when you blank on a command
  4. A simple model of Git internals that lets you reason out answers
  5. How to explain stash and cherry-pick once you have learned them

SECTION 01Core Git versus the long tail of commands

Not every Git question carries the same weight. When I interview a fresher or junior developer, I sort Git topics into two groups in my head. The core is what you will use on your first day: cloning, committing, branching, pulling, pushing, resolving a simple conflict and opening a pull request. The long tail is everything you will use occasionally: cherry-pick, bisect, submodules, interactive rebase, worktrees.

A gap in the long tail is normal at the junior level, because you only learn those commands when a real situation needs them. A gap in the core worries me more, because it means daily work will be slow. So if you stumble, the first question is which group the topic belongs to.

TopicGroupWeight of a weak answerWhat I expect from a junior
commit, add, status, logCoreHighUse them fluently without notes
branch, checkout or switch, mergeCoreHighCreate, switch and merge branches confidently
stash, reset vs revertMiddleMediumKnow the purpose, even if flags are fuzzy
cherry-pick, bisect, submodulesLong tailLowKnow they exist, reason about what they do
Q: How would you use git bisect?

A: I have not used bisect in a project.
I know it helps find which commit introduced
a bug. I think it does a binary search
between a good and a bad commit, and I mark
each step as good or bad. I would read the
docs and try it on a small repo first.

My note: long-tail gap, honest, reasoned. Fine.
core-vs-tail.txt

If you are unsure whether a topic is core, a safe assumption is this: if you would need it every week on a team, it is core. Spend your preparation time there first.

Key insight: A weak answer on a rare command is a small dent. A weak answer on the staging area or branches is a bigger one. Prepare in that order, and do not panic about the long tail.

SECTION 02How to recover in the next two minutes

The moments after a weak answer often matter more than the answer itself. Some candidates go quiet and carry the mistake into every later question. Others bluff and give a confident but wrong command, which is worse, because now I am unsure whether to trust their other answers.

The recovery that works is simple. Admit the gap in one sentence, say what you do know that is nearby, and reason towards an approach. Then move on calmly. If a later question touches the same topic, show that you are thinking about it. I notice candidates who come back and say 'about the stash question earlier, I think it would also help here.'

ReactionExample lineHow it landsEffect on the decision
Freeze and stopI don't know.No method visibleGap counts fully
BluffUse git save --temp.Wrong and confidentTrust in other answers drops
Admit and reasonI haven't used it, but I would need to save changes somewhere...Honest and logicalGap is softened
Admit, reason, return laterEarlier I mentioned stash, it fits here tooLearning in real timeCan become a positive
WHEN YOU BLANK ON A GIT COMMAND

1. Admit briefly:
   "I don't remember the exact command."

2. State the goal in your words:
   "The goal is to save my unfinished changes
    so I can switch branches without committing."

3. Offer what you would do:
   "I could commit them as WIP on my branch and
    amend later, or I think git has a stash
    feature for exactly this."

4. Move on calmly. Do not apologise again.
recover-and-learn.txt

Notice that the recovery script offers a workaround that really works: a WIP commit on your own branch. Even without remembering stash, that answer shows you understand what Git is for.

Remember: Never invent a command name. Saying 'I would check the docs for the exact flag' is completely acceptable. A made-up command makes me doubt everything else you said.

SECTION 03Reason from how Git works, not from memory

The best protection against blanking is a small mental model of Git internals. You do not need to know everything. Four ideas are enough. A commit is a snapshot of your files plus a pointer to its parent commit. A branch is just a movable label pointing at one commit. HEAD points to the branch you are on. Most commands either create commits or move labels.

With that model, you can reason about commands you have never used. Cherry-pick? It must take the change from one commit and create a new commit with that change on the current branch. Reset? It moves the label. When candidates reason like this out loud, the weak answer turns into a strong signal of understanding.

IdeaSimple meaningCommand it explainsWhat it predicts
CommitSnapshot plus parent pointergit commit, git logHistory is a chain of snapshots
BranchA movable label on a commitgit branch, git switchCreating a branch is instant and cheap
HEADWhere you are right nowgit checkout, detached HEADNew commits attach where HEAD points
New commit from a diffCopy a change onto HEADgit cherry-pick, git revertBoth add new commits, IDs differ from the original
# Branches really are tiny files with a SHA inside
git switch -c demo
cat .git/HEAD
# ref: refs/heads/demo

git rev-parse demo
# 4e2c9a1...  (the commit the label points to)

# Note: refs can also be stored in .git/packed-refs,
# so rev-parse is the reliable way to read them.

git log --oneline --decorate -3
# 4e2c9a1 (HEAD -> demo, main) add footer
git-mental-model.sh

The detail about a different SHA is exactly the kind of reasoning that comes from the model. You do not need to have memorised it. You can work it out because a commit includes its parent.

Pro move: When you do not know a command, sketch two or three commits as circles with arrows and a branch label on paper. Drawing the graph while you talk shows real understanding and gives you time to think.
How Uncodemy helps: If you want guided practice, Uncodemy's DevOps Training Course (classroom and online, Noida) pairs live projects with mock interviews, so you learn Git interview questions on work you actually built.

SECTION 04A short plan to close your Git gaps

After an interview with a shaky Git answer, the useful move is to close that exact gap quickly. Use this plan over the next two weeks. It focuses on core topics first and keeps each session short.

AFTER EACH INTERVIEW

Git question I struggled with: ________________
Core, middle or long tail?     ________________
What I said:                   ________________
What I should have said:       ________________

Practice step (in a test repo):
______________________________________________

Date I practised it: ________
Can I explain it aloud now? Y / N
git-gap-plan.md

SECTION 05Mindset tips for the round after a slip

A weak answer only hurts twice if you let it affect the next questions. These habits keep it contained.

  • Treat it as one data point — An interview has many questions. Interviewers form a view from the whole round, so give the next question your full attention.
  • Do not over-apologise — One honest sentence about the gap is enough. Repeated apologies make a small gap feel bigger to both of you.
  • Show your reasoning — Thinking aloud from the commit and branch model often earns more credit than a quick memorised answer would have.
  • Come back if it fits — If a later question connects to your weak topic, mention the link. It shows you are still thinking and learning.
  • Close the gap the same day — Practise the command that evening in a test repo. Next time the question comes up, you will answer from experience.
Pro tip: Interviewers often remember the recovery more than the slip. A calm 'I don't know that one, here is how I would figure it out' is a skill teams value every day.

SECTION 06Interview Q&A — Recovering on Git

Q1What does git stash do?

It saves your uncommitted changes, both staged and unstaged, onto a stack and gives you a clean working directory. That lets you switch branches or pull without committing half-done work. Later, git stash pop applies the latest stash and removes it, while git stash apply applies it but keeps it in the list.

Q2What is git cherry-pick used for?

It applies the change from a specific commit onto the current branch as a new commit. A common use is copying a bug fix from a development branch to a release branch without merging everything else. The new commit gets a different SHA because its parent is different.

Q3What is a branch in Git, technically?

A branch is a lightweight, movable pointer to a commit. When you make a new commit on a branch, the pointer moves forward to it. That is why creating a branch is instant: Git only writes a small reference, it does not copy files.

Q4What is detached HEAD state?

It means HEAD points directly to a commit instead of to a branch, for example after checking out an old commit by its SHA. You can look around and even commit, but those commits are not on any branch. To keep them, create a branch with git switch -c new-branch before switching away.

Q5How does git bisect help in debugging?

You tell Git one commit where the bug exists and one where it did not. Git checks out a commit halfway between, you test and mark it good or bad, and Git keeps halving the range until it finds the first bad commit. git bisect reset returns you to where you started.

SECTION 07Test yourself — Recovering on Git quiz

Five questions. No sign-up.

0 / 5

Pick an answer to see why it is right or wrong.

SECTION 08Frequently asked questions

Will I be rejected for one wrong answer in a technical interview?

Usually not. Interviewers look at the whole round. One wrong answer on a less common topic is often outweighed by strong answers elsewhere, especially if you handled the gap honestly.

How much Git should a fresher know for interviews?

Be fluent in the daily core: add, commit, status, log, branch, switch, merge, pull, push and resolving conflicts. Know the purpose of stash, reset and revert. Commands like bisect and cherry-pick are good to know but not usually deal-breakers.

Is it okay to say I don't know in an interview?

Yes, if you follow it with your reasoning or a related thing you do know. 'I haven't used that, but here is how I would approach it' is far better than guessing or bluffing.

What is the difference between git stash pop and git stash apply?

Both restore stashed changes to your working directory. pop removes the stash entry after applying it, while apply keeps it in the stash list so you can apply it again or onto another branch.

How do I prepare for Git interview questions quickly?

Practise in a throwaway repository rather than only reading. Spend most of your time on core commands and conflicts, then try stash, reset, revert and cherry-pick. Explain each one aloud after you try it.

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.

Classroom & online · Noida

Turn Git gaps into confident answers

Our DevOps Training Course builds Git skills through hands-on labs and team projects, so core commands become habit and rarer ones are easy to reason out.

Talk to a counsellor for current fees
  • Guided Git labs
  • Real merge conflict practice
  • DevOps project work
  • Weekday & weekend batches