Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
git cherry-pick lets you apply a specific commit from one branch to another, without merging the entire branch. Example: Imagine you fixed a typo in the develop branch but need that same fix in main immediately. Instead…
git merge <branch-name> - combines changes from one branch into another. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainabi…
I treat Git as the single source of truth for builds and deployments. My approach: Each merge to main triggers CI/CD pipelines (GitHub Actions, Jenkins, or GitLab CI). Pipelines: Run tests, lint, and security scans. Tag…
I believe in a clean, meaningful Git history that tells the story of the project clearly. Here’s how I maintain it: Use atomic commits (each commit = one logical change) Write clear commit messages: feat: add user profil…
Squashing combines multiple small commits into one clean commit before merging — keeping history tidy. Options: On GitHub: When merging a PR, select “Squash and merge.” On local machine: git rebase -i HEAD~3 Change extra…
You can interactively rebase to edit, squash, or reorder commits using: git rebase -i HEAD~3 This opens an editor showing the last 3 commits: pick 1a2b3c Fix typo in footer pick 4d5e6f Add login API pick 7g8h9i Update UI…
When you run a merge, Git: 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 not use it in…
You can view the commit history by using the command: git log This shows a list of commits, with each commit’s hash, author, date, and message. Real-World Example: Imagine you're trying to figure out when a bug was intro…
Answer: Manually editing files to combine conflicting changes, then staging and committing them. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, m…
base commit, creating a linear history. 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…
Answer: Rewrites commit history by moving a sequence of commits to a new base commit, creating a linear history. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs…
Uploads your local branch commits to a remote repository. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When yo…
local repository, but doesn't merge them. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When you would and woul…
Answer: Downloads commits, files, and refs from a remote repository into your local repository, but doesn't merge them. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Tra…
Answer: git remote add <name> <url> - links a local repository to a remote one (e.g., GitHub). What interviewers expect A clear definition tied to Version Control in Git & GitHub projects…
git clone <url> - creates a local copy of a remote repository. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, secu…
intentionally ignore from being tracked. 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…
Answer: A file (.gitignore) that tells Git which files or directories to intentionally ignore from being tracked. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-off…
git status (summary), git diff (detailed changes). What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When you would…
git reset HEAD <file> (unstage). What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When you would and…
working dir changes), git reset HEAD <file> (unstage). What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, co…
Answer: (Duplicate of #18) git restore <file> (unstage/discard working dir changes), git reset HEAD <file> (unstage). What interviewers expect A clear definition tied to Version Control in Git…
nd optionally changes the staging area/working directory to a specified commit. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, s…
Answer: git reset --soft/--mixed/--hard <commit> - moves HEAD and optionally changes the staging area/working directory to a specified commit. What interviewers expect A clear definition tied to Version Con…
changes of a previous commit, preserving history. What interviewers expect A clear definition tied to Version Control in Git & GitHub projects Trade-offs (performance, maintainability, security, cost) When you would…
Git & GitHub Developer Essentials · Version Control
git cherry-pick lets you apply a specific commit from one branch to another, without
merging the entire branch.
Example:
Imagine you fixed a typo in the develop branch but need that same fix in main
immediately. Instead of merging all of develop, you can just cherry-pick that commit:
git cherry-pick 1a2b3c4
Real-world use case:
Useful when you want to apply a hotfix or small bug fix without merging unrelated feature
work.
Git & GitHub Developer Essentials · Version Control
git merge <branch-name> - combines changes from one branch into another.
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
I treat Git as the single source of truth for builds and deployments.
My approach:
CI).
Best practices:
Example:
In a microservices project, each push to main triggered automated Docker builds.
Tagging a commit with v2.3.1 automatically deployed that version to production —
ensuring traceability and rollback capability.
✅ In summary:
The key to mastering Git isn’t just knowing commands — it’s knowing how to
recover, clean, and automate safely.
Bonus / DevOps Integration
Git & GitHub Developer Essentials · Version Control
I believe in a clean, meaningful Git history that tells the story of the project clearly.
Here’s how I maintain it:
Write clear commit messages:
feat: add user profile API
fix: correct typo in dashboard title
chore: update dependencies
Example:
When reviewing history later, I can quickly find “where” and “why” a change was made — no
messy “temp commit” or “final fix” messages.
✅ In short:
healthy Git workflow = clear branches, clean commits, automated checks, and
collaborative reviews.
Real-World & Troubleshooting
Scenarios
Git & GitHub Developer Essentials · Version Control
Squashing combines multiple small commits into one clean commit before merging —
keeping history tidy.
Options:
When merging a PR, select “Squash and merge.”
On local machine:
git rebase -i HEAD~3
Change extra commits from pick → squash and then push with:
git push -f
If your PR has 10 commits like “fix typo,” “oops forgot semicolon,” and “final fix,” you squash
them into one commit:
👉 Add responsive navbar component
✅ Pro Tip:
clean workflow often looks like this:
Git & GitHub Developer Essentials · Version Control
You can interactively rebase to edit, squash, or reorder commits using:
git rebase -i HEAD~3
This opens an editor showing the last 3 commits:
pick 1a2b3c Fix typo in footer
pick 4d5e6f Add login API
pick 7g8h9i Update UI color scheme
You can change:
Real-world example:
Before merging your feature branch, you may use git rebase -i to combine small “fix
typo” or “debug print” commits into a clean, single commit.
⚠ Don’t rewrite history on shared branches that others are using — it can
cause conflicts and confusion.
GitHub & Remote Repository
Management
Git & GitHub Developer Essentials · Version Control
When you run a merge, Git:
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
You can view the commit history by using the command:
git log
This shows a list of commits, with each commit’s hash, author, date, and message.
Real-World Example:
Imagine you're trying to figure out when a bug was introduced to your code. By running git
log, you can see all previous commits, helping you pinpoint the changes that might have
caused the issue.
Branching & Merging
Git & GitHub Developer Essentials · Version Control
Answer: Manually editing files to combine conflicting changes, then staging and committing them.
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
base commit, creating a linear 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: Rewrites commit history by moving a sequence of commits to a new base commit, creating a linear 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
Uploads your local branch commits to a remote 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
local repository, but doesn't merge them.
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: Downloads commits, files, and refs from a remote repository into your local repository, but doesn't merge them.
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: git remote add <name> <url> - links a local repository to a remote one (e.g., 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
git clone <url> - creates a local copy of a remote 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
intentionally ignore from being tracked.
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 file (.gitignore) that tells Git which files or directories to intentionally ignore from being tracked.
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
git status (summary), git diff (detailed changes).
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
git reset HEAD <file> (unstage).
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
working dir changes), git reset HEAD <file> (unstage).
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 #18) git restore <file> (unstage/discard working dir changes), git reset HEAD <file> (unstage).
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
nd optionally changes the staging area/working directory to a specified 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
Answer: git reset --soft/--mixed/--hard <commit> - moves HEAD and optionally changes the staging area/working directory to a specified 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
changes of a previous commit, preserving 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.