Git and GitHub interview questions
The Git and GitHub questions interviewers ask most, with short answers you can explain in your own words. Tap a question to see the answer.
01Git vs GitHub?+
Git is the version control tool. GitHub is a hosting platform for Git repositories with pull requests, issues and Actions.
02What are the three areas in Git?+
The working directory, the staging area (index) and the repository (commits).
03git fetch vs git pull?+
fetch downloads changes without merging. pull is fetch plus merge (or rebase).
04merge vs rebase?+
Merge joins branches with a merge commit and keeps history as it happened. Rebase replays commits on a new base for a linear history. Do not rebase shared branches.
05How do you resolve a merge conflict?+
Open the conflicted files, choose the correct content, remove the markers, then git add and commit.
06git reset vs git revert?+
reset moves the branch pointer and can rewrite history. revert creates a new commit that undoes a previous one, safe for shared branches.
07What is a pull request?+
A request to merge a branch, where teammates review code, run checks and discuss before merging.
08What is .gitignore?+
A file listing paths Git should not track, like secrets, virtual environments and build outputs.
09What does git stash do?+
Saves uncommitted changes temporarily so you can switch branches, and restores them later with git stash pop.
10What is a fork?+
Your own copy of someone else's repository on GitHub, used to propose changes via pull requests.
11What is cherry-pick?+
Applying a specific commit from one branch onto another.
12What is HEAD?+
A pointer to the current commit or branch you are on.
13How do you undo the last commit but keep the changes?+
Use a soft reset.
git reset --soft HEAD~114What is a detached HEAD?+
When you check out a commit instead of a branch. New commits there are easy to lose unless you create a branch.
15What is branch protection?+
GitHub rules on a branch like main: required reviews, passing checks and no force pushes.
16What is GitHub Actions?+
GitHub's CI/CD: workflows in YAML that run on events like push or pull request, for tests, linting and deployments.
17What makes a good commit message?+
A short imperative summary like 'Add incremental load for orders', with details in the body if needed.
18What branching strategy do you use?+
Usually GitHub flow: short-lived feature branches from main, pull requests, review and merge.
19Never commit what?+
Passwords, keys, tokens and large data files. Use environment variables, secret stores and .gitignore.
20How is Git used with data tools?+
Databricks Git folders, ADF and Fabric Git integration, and SQL and dbt projects in repositories with CI checks.
Save with packages
Bundles that include Git and GitHub. See all packages →
Git & GitHub Combo
Git & GitHub, both levels: Intermediate and Advanced.
Complete Bundle
All 12 courses, both levels. 24 PDFs.
Questions before you buy
How do I get the PDF?+
Tap "Buy on WhatsApp". After payment I send you a private download link on WhatsApp, and you can download the file straight away.
How long does delivery take?+
Usually within a few hours of payment, and always within 24 hours.
How do I pay?+
I share the payment options on WhatsApp before you pay. Prices are in US dollars, and you can pay in your local currency at the day's rate.
Can I see a sample first?+
Yes. Every premium pack has a free sample with the first 5 questions. Use the "Free sample" button on the pack.
Can I get a refund?+
Because these are digital files, payments are not refundable once the file is sent. If a file does not open or something is missing, message me and I will fix it quickly.
What students say
All reviews →🎤 Practise with a real mock interview
60 minutes live with Hikmat Ullah, plus written feedback. Bronze 20 USD (1 session), Silver 50 USD (3 sessions), Gold 80 USD (5 sessions).
Git & GitHub
Version control, branching, pull requests and CI, the way real teams work.
Learn it 1:1 → PROJECTSGit & GitHub projects
A free starter project, plus Small, Large and Enterprise projects.
See projects → MOREOther subjects
Free interview questions for all 12 subjects.
All interview questions →