Back to blog Backend Interview

Top 50 Git & GitHub Interview Questions

2 min readBackend Interview

Basic Git Concepts

  1. What is Git and why is it used?
  2. What is the difference between Git and GitHub?
  3. What is a repository in Git?
  4. What is a bare repository?
  5. What does git init do?
  6. What is a commit in Git?
  7. Why do we write commit messages?
  8. What is the staging area (index)?
  9. What is branching?
  10. What is merging?

Git Commands & Usage

  1. Explain git add and how it works.
  2. What is git commit -m?
  3. What does git status show?
  4. What is the purpose of git log?
  5. What is the difference between git pull and git fetch?
  6. How does git push work?
  7. What is git clone?
  8. Explain git diff.
  9. How do you delete a branch?
  10. What does git mv do?

Branching, Rebase, Conflict

  1. What is the difference between merge and rebase?
  2. How do you resolve merge conflicts?
  3. What is a detached HEAD state?
  4. How do you compare two branches?
  5. What is git cherry-pick?
  6. How do you squash commits?
  7. Explain git rebase -i and when you would use it.
  8. What are conflicts and how does Git mark them?
  9. How do you abort a merge?
  10. What is fast-forward merge? (Often asked conceptually)

Advanced Git Concepts

  1. What is git stash and when would you use it?
  2. How to remove or apply a stash? (Follow-up)
  3. What is git reflog useful for?
  4. How to revert a commit that’s already pushed?
  5. What is the difference between git reset and git revert?
  6. What is a tag in Git and how do you create one? (Commonly asked)
  7. What is the difference between lightweight and annotated tags? (Common conceptual question)
  8. What are submodules in Git?
  9. What is Git LFS (Large File Storage)?
  10. What are hooks in Git?

GitHub Specific Questions

  1. What is GitHub?
  2. What is a pull request? (GitHub core concept)
  3. How is GitHub different from Git?
  4. Explain GitHub Issues and Projects. (Often asked)
  5. What are GitHub Actions? (CI/CD workflows)
  6. What is forking vs cloning on GitHub? (Important)
  7. How do you resolve merge conflicts on GitHub? (Scenario-oriented)
  8. What is the GitHub flow? (Workflow question)
  9. How do you manage releases or versioning in GitHub? (Practical)
  10. What are protected branches and why do we use them on GitHub? (Policy question)

InterviewExpert.org

Writing about interviews, stacks, and getting hired.

Leave a comment