QA
🌿
DevOps & OS

Git & GitHub Interview Questions

Version control mastery covering internal objects (blobs, trees, commits), interactive rebasing, bisecting bugs, git hooks, and CI workflows.

🎯 Ready to test your knowledge?

Take Git & GitHub Skill Assessment Quiz

First prepare from the 100 learning questions below, then test your skills with 15 random MCQs categorized into Beginner, Intermediate, and Senior levels.

Launch 15-MCQ Quiz →
Experience Level:

Showing 100 Questions

Beginner LevelGit & GitHub

1. Compare git rebase versus git merge and explain how git bisect finds regressions.

❓ Context: What are the pros/cons of linear commit history with rebase vs explicit merge commits? How does binary search in git bisect work?

'git merge' creates a new merge commit combining two branch histories. It preserves full historical context but can clutter git graphs.

'git rebase' rewrites history by applying your branch commits sequentially on top of the target branch tip, creating a linear history.

'git bisect' uses a binary search algorithm to pinpoint the exact commit that introduced a bug between a known 'good' and 'bad' commit.

bash
# Interactive rebase to squash last 3 commits into 1
git rebase -i HEAD~3

# Starting automated git bisect to find broken build
git bisect start
git bisect bad HEAD
git bisect good v1.4.0

# When finished:
git bisect reset
💡Git interactive rebase and automated bisect troubleshooting.
🎯 Interview Key Takeaway

Never rebase public shared main/master branches. Use git bisect to locate bug regressions in seconds.

#Git#Rebase#Merge#Bisect#DevOps#Beginner
Permalink
Beginner LevelGit & GitHub

2. What is the difference between git init and git clone?

Beginner LevelGit & GitHub

3. What are the Three Trees in Git (Working Directory, Staging Area / Index, Commit History)?

Beginner LevelGit & GitHub

4. How do git add, git commit, git status, and git diff manage everyday file tracking?

Beginner LevelGit & GitHub

5. How do git branch, git checkout, and git switch manage local branch navigation?

Beginner LevelGit & GitHub

6. What is the difference between git fetch and git pull?

Beginner LevelGit & GitHub

7. How does .gitignore exclude untracked files and build artifacts from Git history?

Beginner LevelGit & GitHub

8. How do git log and git show inspect commit history and file diffs?

Beginner LevelGit & GitHub

9. What is the difference between git reset --soft, --mixed, and --hard?

Beginner LevelGit & GitHub

10. How does git stash temporarily store dirty working directory modifications?

Beginner LevelGit & GitHub

11. How do you manage remote repository connections using git remote?

Beginner LevelGit & GitHub

12. What is the difference between Annotated Tags and Lightweight Tags in Git?

Beginner LevelGit & GitHub

13. How does git restore discard uncommitted local changes?

Beginner LevelGit & GitHub

14. What causes Git Merge Conflicts and how do you manually resolve them?

Beginner LevelGit & GitHub

15. How does git cherry-pick apply specific commits from another branch?

Beginner LevelGit & GitHub

16. How do git config settings configure user.name, user.email, and core.editor?

Beginner LevelGit & GitHub

17. How does git blame identify who modified specific lines of code in a file?

Beginner LevelGit & GitHub

18. What is the difference between git revert and git reset?

Beginner LevelGit & GitHub

19. What is a GitHub Pull Request (PR) and how does code review work?

Beginner LevelGit & GitHub

20. What is the difference between Forking a repository on GitHub and Cloning it?

Beginner LevelGit & GitHub

21. How do you stop tracking a file in Git without deleting it from local disk?

Beginner LevelGit & GitHub

22. What is a Fast-Forward Merge in Git?

Beginner LevelGit & GitHub

23. How do you configure custom Git Command Aliases?

Beginner LevelGit & GitHub

24. How do you remove untracked files and directories using git clean?

Beginner LevelGit & GitHub

25. How do GitHub Issues, Labels, and Milestones organize project tasks?

Beginner LevelGit & GitHub

26. What is git reflog and how does it recover "lost" commits or deleted branches?

Beginner LevelGit & GitHub

27. How do you modify the last commit message or add staged files using git commit --amend?

Beginner LevelGit & GitHub

28. How do you delete local branches and remote branches?

Beginner LevelGit & GitHub

29. How do README.md files document repositories using GitHub Flavored Markdown?

Beginner LevelGit & GitHub

30. What is a Detached HEAD state in Git and how do you fix it?

Intermediate LevelGit & GitHub

31. How do you perform Interactive Rebasing to squash and reorder commits?

Intermediate LevelGit & GitHub

32. What is the difference between Git Submodules and Git Subtrees?

Intermediate LevelGit & GitHub

33. How do Git Hooks and Husky automate code linting and formatting before commits?

Intermediate LevelGit & GitHub

34. How do GitHub Actions workflows automate CI/CD pipelines?

Intermediate LevelGit & GitHub

35. What is GitFlow branching strategy?

Intermediate LevelGit & GitHub

36. What is Trunk-Based Development and how does it compare to GitFlow?

Intermediate LevelGit & GitHub

37. What is git worktree and how does it allow working on multiple branches simultaneously?

Intermediate LevelGit & GitHub

38. What is Git LFS (Large File Storage) and how does it handle binary assets?

Intermediate LevelGit & GitHub

39. What are the 4 fundamental Git Object types (Blob, Tree, Commit, Tag)?

Intermediate LevelGit & GitHub

40. How do SSH Keys and GPG Signature Signing work in Git and GitHub?

Intermediate LevelGit & GitHub

41. What is git rerere (Reuse Recorded Resolution) and how does it automate conflict resolution?

Intermediate LevelGit & GitHub

42. How does the CODEOWNERS file automatically assign pull request reviewers?

Intermediate LevelGit & GitHub

43. What is git bundle and how do you transfer repositories offline without network access?

Intermediate LevelGit & GitHub

44. How do GitHub Branch Protection Rules enforce required status checks and reviews?

Intermediate LevelGit & GitHub

45. How does git sparse-checkout allow cloning partial directories of giant monorepos?

Intermediate LevelGit & GitHub

46. What is a Shallow Clone (git clone --depth 1) and why is it used in CI/CD?

Intermediate LevelGit & GitHub

47. How does GitHub Dependabot automatically detect and patch vulnerable npm dependencies?

Intermediate LevelGit & GitHub

48. How does git range-diff compare two iterations of a rebased branch?

Intermediate LevelGit & GitHub

49. How do GitHub Releases link tag commits to compiled release assets?

Intermediate LevelGit & GitHub

50. How does git gc (Garbage Collection) pack loose objects into Packfiles?

Intermediate LevelGit & GitHub

51. What is git notes and how do you attach metadata to commits without altering commit hashes?

Intermediate LevelGit & GitHub

52. How do GitHub Discussions provide community forums distinct from GitHub Issues?

Intermediate LevelGit & GitHub

53. How do you purge accidentally committed passwords using git filter-repo?

Intermediate LevelGit & GitHub

54. How does git archive create a zip or tarball of a specific commit without .git folders?

Intermediate LevelGit & GitHub

55. How do GitHub Actions Secrets manage API keys and deployment credentials securely?

Intermediate LevelGit & GitHub

56. What are Git Merge Strategies (ort, recursive, octopus, ours, theirs)?

Intermediate LevelGit & GitHub

57. How do Issue and Pull Request Templates standardize submissions?

Intermediate LevelGit & GitHub

58. How do git format-patch and git am share commits via email patch files?

Intermediate LevelGit & GitHub

59. What is the difference between GitHub Apps and legacy GitHub OAuth Apps?

Intermediate LevelGit & GitHub

60. What is the Conventional Commits specification?

Intermediate LevelGit & GitHub

61. How does git check-ignore troubleshoot why a file is ignored by Git?

Intermediate LevelGit & GitHub

62. How do GitHub Deployment Environments manage approval gates for staging vs production?

Intermediate LevelGit & GitHub

63. What is the difference between git diff and git diff --staged?

Intermediate LevelGit & GitHub

64. How do GitHub Security Advisories publish vulnerabilities and request CVE IDs?

Intermediate LevelGit & GitHub

65. What is git symbolic-ref and how does it manage the HEAD reference file?

Intermediate LevelGit & GitHub

66. How does GitHub Pages host static websites directly from GitHub repositories?

Intermediate LevelGit & GitHub

67. How do you automate bug isolation using git bisect run?

Intermediate LevelGit & GitHub

68. How does the GitHub CLI (gh) bring GitHub features to the terminal prompt?

Intermediate LevelGit & GitHub

69. How does git rebase --onto transplant a branch segment to a different base commit?

Intermediate LevelGit & GitHub

70. How does GitHub Packages host container images and npm packages?

Senior LevelGit & GitHub

71. How does Git handle Object Format migration from SHA-1 to SHA-256 cryptographic hashes?

Senior LevelGit & GitHub

72. How does Microsoft Scalar optimize Git performance for multi-gigabyte monorepos?

Senior LevelGit & GitHub

73. What is the Commit-Graph file (.git/objects/info/commit-graph) and how does it accelerate DAG traversal?

Senior LevelGit & GitHub

74. How does the FSMonitor hook eliminate working directory scan delays on macOS and Windows?

Senior LevelGit & GitHub

75. How does Git Delta Compression compress object data inside Packfiles?

Senior LevelGit & GitHub

76. How do you write custom Git Merge Drivers in .gitattributes for specialized file formats?

Senior LevelGit & GitHub

77. How does Git Wire Protocol v2 optimize fetch negotiation and reference advertisement?

Senior LevelGit & GitHub

78. How do you architect High Availability (HA) for GitHub Enterprise Server (GHES)?

Senior LevelGit & GitHub

79. What is Index File Format v4 and how does prefix compression shrink the .git/index file?

Senior LevelGit & GitHub

80. How does the Sparse Index feature scale index operations in partial clones?

Senior LevelGit & GitHub

81. How do you use git rebase --exec to run automated unit tests on every commit in a branch?

Senior LevelGit & GitHub

82. How do Git Clean and Smudge filters execute transparent content transformations?

Senior LevelGit & GitHub

83. How does VFS for Git virtualize filesystem downloads on demand?

Senior LevelGit & GitHub

84. How do you stream GitHub Enterprise Audit Logs into SIEM platforms (Splunk, Datadog)?

Senior LevelGit & GitHub

85. How do you configure custom 3-way merge tools in .gitconfig?

Senior LevelGit & GitHub

86. How does the .mailmap file sanitize duplicate author names and email addresses in git log?

Senior LevelGit & GitHub

87. How do you build custom GitHub Actions (Docker container vs Composite Actions)?

Senior LevelGit & GitHub

88. What are Reachability Bitmaps (.bitmap) and how do they accelerate server fetch requests?

Senior LevelGit & GitHub

89. How does the Smart HTTP Transfer Protocol handle authentication and packfile streaming?

Senior LevelGit & GitHub

90. How does GitHub Actions OIDC assume AWS IAM roles without long-lived keys?

Senior LevelGit & GitHub

91. How does git maintenance run background optimization tasks?

Senior LevelGit & GitHub

92. How do you test GitHub Actions workflows locally using act?

Senior LevelGit & GitHub

93. What is the Multi-Pack-Index (MIDX) file and how does it optimize repositories with hundreds of packfiles?

Senior LevelGit & GitHub

94. How do you write custom Regular Expression patterns for GitHub Secret Scanning?

Senior LevelGit & GitHub

95. How do custom Git Credential Helpers store and refresh OAuth tokens in OS Keychains?

Senior LevelGit & GitHub

96. Compare GitHub REST API v3 vs GitHub GraphQL API v4 for enterprise integration.

Senior LevelGit & GitHub

97. How do you use git subtree split to extract a sub-directory into a standalone repository?

Senior LevelGit & GitHub

98. How does Actions Runner Controller (ARC) auto-scale self-hosted GitHub runners on Kubernetes?

Senior LevelGit & GitHub

99. How do you diagnose and repair corrupted Git object databases using git fsck?

Senior LevelGit & GitHub

100. What is the future trajectory of Git and GitHub (AI Code Review, SHA-256 defaults, monorepo scale)?

How to Prepare for Git & GitHub Technical Interviews in 2026

When interviewing for software engineering positions that utilize Git & GitHub, hiring managers look for a combination of fundamental syntax proficiency, architectural understanding, code optimization techniques, and practical debugging skills.

🌱 Beginner FocusCore syntax, default configurations, standard API definitions, and avoiding common basic errors.
⚡ Intermediate FocusAsync execution patterns, performance profiling, component lifecycle, and state management.
🏆 Senior FocusInternal runtime mechanics, memory leaks, scalability bottlenecks, system design trade-offs, and security mitigation.