WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. First 15 min FREE →

100 Git Interview Questions and Answers

DevOps, Cloud & Tools · 100 questions, each with a full written answer — free, no sign-up.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Git interview — then scores it.
📞 Practice Git — free 15 min
📕 Buy this interview preparation book: 100 Git questions & answers — PDF + EPUB for $5
Basic 20Intermediate 20Advanced 20Expert 20Guru 20

Basic

  1. What is Git?
  2. What is version control, and why is it important?
  3. Can you explain the difference between centralized and distributed version control systems?
  4. How do you initialize a new Git repository?
  5. What is the purpose of the .gitignore file, and how do you create one?
  6. What are the basic Git workflow stages?
  7. What is the difference between ’git add’ and ’git commit’ commands?
  8. Can you explain the difference between ’git fetch’ and ’git pull’?
  9. What is a branch in Git, and how do you create one?
  10. How do you switch between branches in Git?
  11. What is the purpose of ’git merge’, and how do you use it?
  12. What is a ’git rebase’, and when would you use it?
  13. Can you explain the difference between ’git stash’ and ’git stash apply’?
  14. How do you view the commit history in Git?
  15. What is the purpose of the ’git remote’ command, and how do you use it?
  16. How do you clone a repository in Git?
  17. How do you create and apply a patch in Git?
  18. What is the purpose of ’git revert’ and ’git reset’, and what are the differences between them?
  19. How do you resolve merge conflicts in Git?
  20. What are the best practices for writing a good commit message?

Intermediate

  1. What is the difference between a "fast-forward" and a "recursive" merge in Git?
  2. How can you view the differences between the working directory and the most recent commit?
  3. How do you remove untracked files from your working directory?
  4. What is a detached HEAD in Git, and how do you deal with it?
  5. How do you use ’git bisect’ to find a specific commit that introduced a bug?
  6. What is the purpose of ’git cherry-pick’, and how do you use it?
  7. How do you use ’git reflog’, and when would you need it?
  8. Can you explain the difference between a shallow clone and a deep clone in Git?
  9. How do you create and use Git aliases to simplify your workflow?
  10. What are Git submodules, and how do you use them?
  11. How do you squash multiple commits into a single commit using ’git rebase’?
  12. What is the purpose of ’git blame’, and how do you use it?
  13. How do you sign your commits with GPG in Git, and why is it important?
  14. Can you explain the difference between ’git push –force’ and ’git push –force-with-lease’?
  15. How do you set up a Git hook, and what are some common use cases?
  16. How do you manage multiple remote repositories in a single local Git repository?
  17. What is the purpose of ’git tag’, and how do you create and use tags in Git?
  18. How do you configure Git to use a specific text editor or diff tool?
  19. How do you use ’git clean’ to remove untracked files and directories?
  20. What is a Git bare repository, and when would you use one?

Advanced

  1. Can you explain the Git object model, including blobs, trees, and commits?
  2. How does Git store data internally, and what is the role of the Git object database?
  3. What are Git’s packfiles, and how do they optimize repository storage?
  4. Can you explain the concept of a "rebase conflict" and how to resolve it?
  5. How do you interact with Git’s staging area without using ’git add’ and ’git rm’ commands?
  6. How do you split a repository into multiple smaller repositories while preserving history?
  7. Can you describe the process of rebasing an entire branch onto another branch, including resolving conflicts?
  8. How do you use ’git filter-branch’ or ’git filter-repo’ to modify the history of a Git repository?
  9. How do you use ’git refspec’ to configure advanced push and fetch behaviors?
  10. What is the Git garbage collection process, and when should it be run manually?
  11. How do you configure a Git repository to use Large File Storage (LFS)?
  12. How do you use ’git rerere’ to reuse resolved merge conflicts, and what are the potential risks?
  13. What are some advanced techniques for searching Git commit history, such as using ’git log’ with custom formats and filters?
  14. Can you explain the purpose of ’git notes’, and how do you use them?
  15. How do you implement a custom merge strategy in Git?
  16. What is the Git ’replace’ command, and what are some use cases for it?
  17. How do you use ’git worktree’ to manage multiple working directories for a single Git repository?
  18. How do you use ’git bundle’ to share a repository without using a remote server?
  19. Can you describe Git’s internal mechanisms for handling file renames and moves?
  20. What are some best practices for managing large-scale Git repositories with multiple teams and projects?

Expert

  1. Can you discuss Git’s internal storage mechanism, including the role of loose objects and packfiles?
  2. How does Git’s content-addressable storage work, and how does it contribute to Git’s performance?
  3. How do you recover lost commits or branches in Git using the ’git reflog’ and ’git fsck’ commands?
  4. Can you explain Git’s three-way merge algorithm and its handling of merge conflicts?
  5. How do you design and implement a custom Git workflow tailored to a specific development team’s needs?
  6. How do you configure and manage access control in a Git repository, including using Gitolite or other access management tools?
  7. What are some strategies for maintaining a healthy Git repository, including periodic maintenance tasks and performance optimizations?
  8. How do you use ’git bisect run’ to automate the process of finding a commit that introduced a bug?
  9. Can you discuss some advanced techniques for dealing with large binary files in a Git repository?
  10. How do you use ’git rerere’ to handle repeated merge conflicts in long-lived branches?
  11. How do you perform advanced Git history rewriting, such as reordering commits, changing commit messages, or modifying the authorship of a commit?
  12. How do you deal with Git submodules when merging, rebasing, or bisecting?
  13. What are the security implications of Git’s SHA-1 hashing algorithm, and how does the transition to SHA-256 affect Git workflows?
  14. How do you set up and manage a Git server, such as GitLab or GitHub Enterprise, to meet the needs of a large organization?
  15. What are some advanced techniques for managing Git hooks, including sharing hooks across a team or organization?
  16. Can you explain the concept of "grafts" in Git and provide some use cases for them?
  17. How do you implement continuous integration and deployment workflows using Git?
  18. What are some strategies for using Git with other version control systems, such as SVN or Mercurial, in a mixed environment?
  19. How do you use ’git subtree’ to manage large projects with multiple components and their dependencies?
  20. Can you discuss the limitations of Git’s distributed model and propose solutions for dealing with issues like repository size, performance, and collaboration in large teams?

Guru

  1. How do you handle repositories with extremely large files, and what are the performance implications of such repositories in Git?
  2. Can you discuss the trade-offs between using a monorepo versus a multi-repo setup in a large organization?
  3. What are some advanced Git branching models and best practices for managing complex projects with multiple releases and parallel development?
  4. How do you set up and manage Git LFS (Large File Storage) at scale for a large organization?
  5. How do you design and enforce policies for commit signing and verification in a large organization?
  6. Can you discuss the internals of Git’s transfer protocols (smart HTTP, SSH, Git protocol), and their performance implications?
  7. What are the security concerns and best practices for managing access to a large-scale Git-based infrastructure?
  8. How do you handle and recover from Git repository corruption, and what are the common causes of corruption?
  9. Can you discuss techniques for optimizing Git performance, such as reducing repository size, improving network efficiency, and speeding up common operations?
  10. How do you set up and manage Git mirroring and replication for high availability and improved performance in a distributed environment?
  11. How do you create and manage custom Git commands and extensions to address unique requirements within an organization?
  12. Can you discuss techniques for advanced conflict resolution in Git, including resolving complex merge conflicts in large-scale projects?
  13. How do you implement and enforce code review policies and practices using Git and Git-based platforms like GitHub, GitLab, or Bitbucket?
  14. How do you integrate Git with other development tools and platforms, such as continuous integration systems, project management tools, and code review tools?
  15. How do you manage and enforce branch protection policies in a Git repository to ensure code quality and prevent unintended changes?
  16. Can you discuss strategies for managing Git’s configuration settings at the user, repository, and organization levels to enforce best practices?
  17. How do you manage and recover from issues with Git submodules or subtrees in a large-scale project?
  18. How do you troubleshoot and resolve performance issues with Git operations, such as slow clone, fetch, or push operations?
  19. How do you handle and mitigate security vulnerabilities in Git itself and Git-based platforms like GitHub, GitLab, or Bitbucket?
  20. What are the challenges and best practices for managing Git repositories in a geographically distributed team or organization?
📕 Buy this interview preparation book: 100 Git questions & answers — PDF + EPUB for $5
Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Git interview — then scores it.
📞 Practice Git — free 15 min