Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Comman Description Safe for shared repos? git revert Creates a new commit that undoes changes from a previous commit ✅ Yes git reset Moves the branch pointer back to a previous commit, potentially removing commits ❌ No (…
A Pull Request is a request to merge your changes from one branch or fork into another repository or branch — typically to propose new code, bug fixes, or improvements. Example: You fixed a typo or added a feature in you…
A commit in Git is a snapshot of your project at a specific point in time. It records all the changes you've made to the files and saves them to the repository. Every commit has a unique ID, and it's like a save point in…
git stash temporarily saves your uncommitted changes so you can work on something else without committing unfinished work. Example: You’re fixing a login bug but suddenly need to switch branches to fix a production issue…
A fast-forward merge happens when the target branch has not diverged — meaning, there re no new commits on main since you branched off. Git simply moves the branch pointer forward to include all your new commits, without…
git stash temporarily saves your uncommitted changes so you can work on something else without committing unfinished work. Example: You’re fixing a login bug but suddenly need to switch branches to fix a production issue…
git fetch: It retrieves changes from a remote repository but does not apply them to your working directory. You can think of it as checking for updates without actually installing them. git pull: This does two things: it…
time, including changes and a message. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When you would and would n…
Answer: (Duplicate of #4) A snapshot of your project at a specific point in time, including changes and a message. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-of…
A lightweight, movable pointer to a commit, allowing for parallel development. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, se…
spect GitHub Flow Git Flow Purpose Simple branching model for continuous delivery Structured model for release management Branche Only main and short-lived feature branches Multiple: main, develop, feature, release, hotf…
A detached HEAD happens when Git’s HEAD (your current position) points to a specific commit instead of a branch. If you make new commits in this state, they won’t belong to any branch — you could lose them if you switch…
A detached HEAD occurs when Git’s HEAD (which points to your current branch) points to a specific commit instead of a branch. This means you’re not working on any branch — any new commits made in this state are “orphaned…
The .gitignore file tells Git which files or directories it should ignore when tracking changes. This is useful for files that aren’t necessary in the repository, like log files, compiled binaries, or local configuration…
to build, test, and deploy code directly from GitHub. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When you wo…
Answer: The default name for the remote repository from which a project was originally cloned. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, mai…
A pointer to the current commit you are on in your local repository. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, co…
Answer: A configuration file that stores user-specific Git settings (e.g., username, email, aliases). What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performan…
Shows changes between the staging area and the last commit. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When…
Displays the commit history of the current branch. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When you would…
Shows the URLs of the remote repositories associated with your local repo. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, securi…
performing a binary search on the commit history. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When you would…
Answer: A command used to find the commit that introduced a bug by performing a binary search on the commit history. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-…
Checks the integrity of the Git file system. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When you would and w…
Cleans up unnecessary files and optimizes the local repository. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) W…
Git & GitHub Developer Essentials · Version Control
Comman
Description Safe for shared
repos?
git revert Creates a new commit that undoes changes from a
previous commit
✅ Yes
git reset Moves the branch pointer back to a previous commit,
potentially removing commits
❌ No (rewrites
history)
Example:
If you realize a commit caused an error:
Git & GitHub Developer Essentials · Version Control
A Pull Request is a request to merge your changes from one branch or fork into another
repository or branch — typically to propose new code, bug fixes, or improvements.
Example:
You fixed a typo or added a feature in your fork of a project. You create a PR asking the
original maintainers to “pull” your changes into their main branch.
PRs enable:
Git & GitHub Developer Essentials · Version Control
A commit in Git is a snapshot of your project at a specific point in time. It records all the
changes you've made to the files and saves them to the repository. Every commit has a
unique ID, and it's like a save point in a video game—if something breaks, you can go back
to any commit.
Real-World Example:
Let’s say you fixed a bug on the homepage of your app. After completing the fix, you commit
the changes to the repository. Later, if the fix causes an issue, you can roll back to the
previous commit.
Git & GitHub Developer Essentials · Version Control
git stash temporarily saves your uncommitted changes so you can work on something
else without committing unfinished work.
Example:
You’re fixing a login bug but suddenly need to switch branches to fix a production issue.
Instead of committing half-done code, you run:
git stash
git checkout main
Later, you can come back and reapply your stashed work.
Git & GitHub Developer Essentials · Version Control
A fast-forward merge happens when the target branch has not diverged — meaning, there
re no new commits on main since you branched off. Git simply moves the branch pointer
forward to include all your new commits, without creating a new merge commit.
Example:
If main has not changed since you created your feature/navbar branch, merging it back
will simply “fast-forward” main to the latest commit.
git merge feature/navbar
No merge commit — just a pointer move.
Git & GitHub Developer Essentials · Version Control
git stash temporarily saves your uncommitted changes so you can work on something
else without committing unfinished work.
Example:
You’re fixing a login bug but suddenly need to switch branches to fix a production issue.
Instead of committing half-done code, you run:
git stash
git checkout main
Later, you can come back and reapply your stashed work.
Git & GitHub Developer Essentials · Version Control
your working directory. You can think of it as checking for updates without actually
installing them.
into your current branch. It's like fetching updates and immediately applying them.
Real-World Example:
If you're working on a project with teammates, git fetch allows you to see what changes
have been made without affecting your code. git pull, on the other hand, will update your
local copy and merge those changes with your work, which can sometimes result in merge
conflicts.
Git & GitHub Developer Essentials · Version Control
time, including changes and a message.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
Answer: (Duplicate of #4) A snapshot of your project at a specific point in time, including changes and a message.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
A lightweight, movable pointer to a commit, allowing for parallel development.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
spect GitHub Flow Git Flow
Purpose Simple branching model for
continuous delivery
Structured model for release
management
Branche
Only main and short-lived feature
branches
Multiple: main, develop, feature,
release, hotfix
Workflow Create branch → Commit → Pull
Request → Merge → Deploy
Feature branches merge into develop,
then release/hotfix merges into main
Use Case SaaS projects, frequent deploys Complex products with scheduled
releases
Example:
releases.
Git & GitHub Developer Essentials · Version Control
A detached HEAD happens when Git’s HEAD (your current position) points to a specific
commit instead of a branch. If you make new commits in this state, they won’t belong to any
branch — you could lose them if you switch branches.
How to fix it:
If you accidentally commit in a detached HEAD state:
git switch -c temp-branch
This creates a new branch from your current state so your commits aren’t lost.
Example:
You checked out an old commit to test something:
git checkout a1b2c3d
If you make changes, create a branch to save them before switching back.Git & GitHub Developer Essentials · Version Control
A detached HEAD occurs when Git’s HEAD (which points to your current branch) points to a
specific commit instead of a branch. This means you’re not working on any branch — any
new commits made in this state are “orphaned” unless you create a branch from them.
Example:
If you check out an old commit directly:
git checkout a1b2c3d
You’re in a detached HEAD state.
If you make changes here and don’t create a new branch, you could lose them later.
Fix:
Create a new branch to save your work:
git checkout -b hotfix/rollback-test
Git & GitHub Developer Essentials · Version Control
The .gitignore file tells Git which files or directories it should ignore when tracking
changes. This is useful for files that aren’t necessary in the repository, like log files, compiled
binaries, or local configuration files.
Real-World Example:
If you're working on a Node.js project, you likely don’t want to track the node_modules/
directory, since it can be recreated by running npm install. You can add
node_modules/ to your .gitignore file to ensure that Git doesn't track those files.
Git & GitHub Developer Essentials · Version Control
to build, test, and deploy code directly from GitHub.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
Answer: The default name for the remote repository from which a project was originally cloned.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
A pointer to the current commit you are on in your local repository.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
Answer: A configuration file that stores user-specific Git settings (e.g., username, email, aliases).
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
Shows changes between the staging area and the last commit.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
Displays the commit history of the current branch.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
Shows the URLs of the remote repositories associated with your local repo.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
performing a binary search on the commit history.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
Answer: A command used to find the commit that introduced a bug by performing a binary search on the commit history.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
Checks the integrity of the Git file system.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
Git & GitHub Developer Essentials · Version Control
Cleans up unnecessary files and optimizes the local repository.
In a production Git & GitHub application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.