Blog
Top 50 Git & GitHub Interview Questions
- February 6, 2026
- Posted by: InterviewExpert.org
- Category: Backend Interview Preparation Dev Ops
No Comments
Basic Git Concepts
- What is Git and why is it used?
- What is the difference between Git and GitHub?
- What is a repository in Git?
- What is a bare repository?
- What does
git initdo? - What is a commit in Git?
- Why do we write commit messages?
- What is the staging area (index)?
- What is branching?
- What is merging?
Git Commands & Usage
- Explain
git addand how it works. - What is
git commit -m? - What does
git statusshow? - What is the purpose of
git log? - What is the difference between
git pullandgit fetch? - How does
git pushwork? - What is
git clone? - Explain
git diff. - How do you delete a branch?
- What does
git mvdo?
Branching, Rebase, Conflict
- What is the difference between merge and rebase?
- How do you resolve merge conflicts?
- What is a detached HEAD state?
- How do you compare two branches?
- What is
git cherry-pick? - How do you squash commits?
- Explain
git rebase -iand when you would use it. - What are conflicts and how does Git mark them?
- How do you abort a merge?
- What is fast-forward merge? (Often asked conceptually)
Advanced Git Concepts
- What is
git stashand when would you use it? - How to remove or apply a stash? (Follow-up)
- What is
git refloguseful for? - How to revert a commit that’s already pushed?
- What is the difference between
git resetandgit revert? - What is a tag in Git and how do you create one? (Commonly asked)
- What is the difference between lightweight and annotated tags? (Common conceptual question)
- What are submodules in Git?
- What is Git LFS (Large File Storage)?
- What are hooks in Git?
GitHub Specific Questions
- What is GitHub?
- What is a pull request? (GitHub core concept)
- How is GitHub different from Git?
- Explain GitHub Issues and Projects. (Often asked)
- What are GitHub Actions? (CI/CD workflows)
- What is forking vs cloning on GitHub? (Important)
- How do you resolve merge conflicts on GitHub? (Scenario-oriented)
- What is the GitHub flow? (Workflow question)
- How do you manage releases or versioning in GitHub? (Practical)
- What are protected branches and why do we use them on GitHub? (Policy question)