DEV Community

Cover image for Prepare for Your Technical Interview: Common Git Questions to Expect
Daniyal Haider
Daniyal Haider

Posted on

Prepare for Your Technical Interview: Common Git Questions to Expect

Git is an essential tool for version control and collaboration in software development. Employers often evaluate candidates’ proficiency with Git to ensure they can handle branching, merging, and troubleshooting version control issues in real-world scenarios. To assist with your interview prep, here’s a curated list of common Git interview questions you should be ready to answer.

Basic Level

  1. What is Git?
  2. What is the difference between Git and GitHub?
  3. What is a repository in Git?
  4. What is the difference between a local and a remote repository?
  5. What is a commit in Git?
  6. What is the purpose of the git init command?
  7. How do you check the status of a repository in Git?
  8. What is the staging area in Git?
  9. What is the difference between git pull and git fetch?

Intermediate Level

  1. What is a branch in Git?
  2. What is the difference between git merge and git rebase?
  3. How do you resolve merge conflicts in Git?
  4. What is a git clone and when would you use it?
  5. What is the .gitignore file used for?
  6. What is a commit hash in Git?
  7. What does the git log command do?
  8. What is a detached HEAD state in Git?
  9. What is a fast-forward merge in Git?

Advanced Level

  1. What is the difference between git reset and git revert?
  2. Explain the concept of cherry pick.
  3. How do you squash commits in Git?
  4. How do you change the commit message of the last commit in Git?
  5. What are Git submodules and when would you use them?
  6. What is the difference between git stash and git commit?
  7. How would you view and recover a deleted branch in Git?
  8. What is an orphan branch in Git?
  9. What is the purpose of git rebase -i (interactive rebase)?
  10. How do you handle large binary files in Git?
  11. Explain the concept of Git hooks.

Expert Level

  1. What is Git flow, and how does it differ from GitHub flow?
  2. Explain how Git works under the hood (SHA-1, objects, and refs).
  3. How does Git handle conflicts when merging binary files?
  4. What are reflogs and how are they useful?
  5. How would you resolve issues caused by a rebase (such as loss of commits or conflicts)?
  6. What is the git bisect command and how does it work?
  7. How do you implement continuous integration (CI) with Git?
  8. What is the purpose of a bare repository in Git?
  9. How do you deal with large-scale repositories in Git?
  10. What are Git workflows?

Top comments (0)