Top 200 Most Asked Git & Github Interview Questions
Comprehensive guide to Version Control basics, core Git commands, branching strategies, and remote synchronization. Essential for developers and DevOps engineers.
0%
Overall Progress
0/200
Status
Problem
Level
2.Why use Version Control?
Easy
3.What is Git?
Easy
4.What is the difference between Git and GitHub?
Easy
5.What is the difference between Git and other VCS (SVN, Mercurial)?
Medium
6.How do you install Git locally?
Easy
7.What is git init?
Easy
8.What is git config?
Easy
9.What is the difference between local and global config?
Medium
10.How do you set username and email in Git?
Easy
11.What is a Git repository?
Easy
12.What is the difference between local and remote repository?
Easy
13.What is Working Directory?
Easy
14.What is Staging Area (Index)?
Medium
15.What is the .git folder?
Medium
16.What is git status?
Easy
17.What is git add? What does it do?
Easy
18.What is the difference between git add . and git add -A?
Medium
19.What is git commit?
Easy
20.What is the difference between git commit -m and git commit -am?
Medium
21.What is git log? What options can you use with it?
Easy
22.What is git diff?
Easy
23.What is the difference between git diff and git diff --staged?
Medium
24.What is .gitignore? How does it work?
Easy
25.How do you ignore files that are already tracked?
Hard
26.What is git rm?
Easy
27.What is the difference between git rm and rm?
Medium
28.What is git mv?
Easy
29.How do you view commit history?
Easy
30.What is HEAD in Git?
Medium
31.What is a branch in Git?
Easy
32.Why do we use branches?
Easy
33.What is the default branch name?
Easy
34.What is git branch?
Easy
35.How do you create a new branch?
Easy
36.What is git checkout?
Easy
37.What is the difference between git checkout and git switch?
Medium
38.How do you create and switch to a branch in one command?
Easy
39.What is git branch -d vs git branch -D?
Medium
40.How do you rename a branch?
Medium
41.How do you delete a branch?
Easy
42.What is git merge?
Medium
43.What are the types of merges (Fast-forward, 3-way merge)?
Hard
44.What is a merge conflict?
Medium
45.How do you resolve merge conflicts?
Medium
46.What is a remote repository?
Easy
47.What is git remote?
Easy
48.How do you add a remote repository?
Easy
49.What is origin in Git?
Easy
50.What is git clone?
Easy
51.What is the difference between cloning and forking?
Medium
52.What is git fetch?
Medium
53.What is git pull?
Easy
54.What is the difference between git fetch and git pull?
Medium
55.What is git push?
Easy
56.What is git push -u origin main? What does -u do?
Medium
57.What is git push --force? When should you use it?
Hard
58.What is upstream branch?
Medium
59.How do you set upstream branch?
Medium
60.How do you delete a remote branch?
Medium
61.What is GitHub?
Easy
62.How do you create a repository on GitHub?
Easy
63.What is the difference between public and private repositories?
Easy
64.What is a README file? Why is it important?
Easy
65.What is Markdown?
Easy
66.How do you write a good README?
Medium
67.What are GitHub Issues?
Easy
68.What is a Pull Request (PR)?
Easy
69.What is the difference between Pull Request and Merge Request?
Easy
70.How do you create a Pull Request?
Easy
71.What are PR guidelines and best practices?
Medium
72.What is code review?
Easy
73.How do you label issues and PRs?
Easy
74.What is forking?
Easy
75.What is the difference between fork and clone?
Medium
76.How do you fork a repository?
Easy
77.What is a PR from a fork?
Medium
78.How do you sync a forked repository?
Hard
79.What are collaborators in GitHub?
Easy
80.How do you add collaborators to a repository?
Easy
81.What are mentions (@username)?
Easy
82.What are reactions in GitHub?
Easy
83.What is commenting on PRs and commits?
Medium
84.What are saved replies?
Easy
85.What are GitHub Discussions?
Medium
86.What is branch naming convention?
Easy
87.What are commit message best practices?
Medium
88.What is conventional commits?
Hard
89.What is Fast-Forward merge?
Medium
90.What is Non-Fast-Forward merge?
Hard
91.What is git merge --no-ff?
Hard
92.What is Squash merge?
Hard
93.What is Rebase?
Hard
94.What is the difference between merge and rebase?
Hard
95.When should you use rebase vs merge?
Hard
96.What is Cherry-picking commits?
Hard
97.What is handling merge conflicts?
Medium
98.What is merge conflict resolution strategies?
Medium
99.What is git stash?
Medium
100.When do you use git stash?
Medium
101.What is git stash pop vs git stash apply?
Medium
102.What is git stash list?
Easy
103.What is Detached HEAD state?
Hard
104.What is git checkout <commit-hash>?
Medium
105.What is git log --oneline?
Easy
106.What is git log --graph?
Medium
107.What is Linear vs Non-Linear history?
Hard
108.What is git reset?
Medium
109.What are the types of reset: --soft, --mixed, --hard?
Hard
110.What is the difference between git reset --soft and --hard?
Hard
111.What is git revert?
Medium
112.What is the difference between git reset and git revert?
Hard
113.When should you use reset vs revert?
Medium
114.What is git checkout -- <file>?
Easy
115.What is git restore?
Medium
116.How do you undo the last commit?
Medium
117.How do you undo changes in working directory?
Easy
118.How do you undo staged changes?
Medium
119.What is git clean?
Medium
120.What is the difference between git clean -n and git clean -f?
Medium
121.How do you view differences between commits?
Easy
122.How do you view differences between branches?
Medium
123.What is git diff HEAD?
Medium
124.How do you view changes in a specific file?
Easy
125.What is git commit --amend?
Medium
126.When do you use git commit --amend?
Medium
127.What is git rebase -i (interactive rebase)?
Hard
128.What is git filter-branch?
Hard
129.What is git push --force-with-lease?
Hard
130.What is rewriting commit history?
Hard
131.Why is rewriting history dangerous in shared branches?
Hard
132.What are GitHub Projects?
Easy
133.What is project planning on GitHub?
Easy
134.What are Kanban boards?
Easy
135.What are roadmaps in GitHub Projects?
Medium
136.What are automations in GitHub Projects?
Medium
137.What are GitHub Organizations?
Easy
138.What is the difference between user account and organization?
Easy
139.What are teams within organizations?
Easy
140.How do you add collaborators and members?
Easy
141.What are GitHub Actions?
Medium
142.What is CI/CD?
Medium
143.What is a workflow in GitHub Actions?
Medium
144.What is YAML syntax for workflows?
Medium
145.What are workflow triggers (push, pull_request, schedule)?
Medium
146.What are scheduled workflows (cron jobs)?
Medium
147.What are workflow runners?
Hard
148.What is workflow context?
Hard
149.What are secrets and environment variables?
Medium
150.What are GitHub Actions use cases?
Medium
151.What are client-side hooks vs server-side hooks?
Hard
152.What is caching dependencies in workflows?
Hard
153.What are storing artifacts in workflows?
Medium
154.What is workflow status?
Easy
155.What are marketplace actions?
Easy
156.What is GitHub CLI?
Medium
157.How do you install and set up GitHub CLI?
Easy
158.How do you manage repositories using CLI?
Medium
159.How do you manage issues using CLI?
Medium
160.How do you manage pull requests using CLI?
Medium
161.What is GitHub REST API?
Hard
162.What is GitHub GraphQL API?
Hard
163.What is the difference between REST and GraphQL API?
Expert
164.What is Git Reflog?
Hard
165.What is Git Bisect?
Expert
166.What is Git Worktree?
Expert
167.What is Git Attributes?
Hard
168.What is Git LFS (Large File Storage)?
Medium
169.When do you need Git LFS?
Medium
170.What are Git Hooks?
Hard
171.What are client-side hooks (pre-commit, post-commit, pre-push)?
Hard
172.What are server-side hooks?
Expert
173.What are submodules in Git?
Hard
174.What is the difference between submodules and subtrees?
Expert
175.How do you add and update submodules?
Hard
176.What are GitHub Pages?
Easy
177.How do you deploy a static website on GitHub Pages?
Easy
178.What are custom domains in GitHub Pages?
Medium
179.What are static site generators (Jekyll)?
Medium
180.What is GitHub Copilot?
Easy
181.What are GitHub Gists?
Easy
182.What are GitHub Packages?
Medium
183.What is GitHub Codespaces?
Easy
184.What is GitHub Marketplace?
Easy
185.What is GitHub Education?
Easy
186.What is Student Developer Pack?
Easy
187.What is GitHub Classroom?
Medium
188.What is Campus Program?
Medium
189.What is GitHub Security?
Medium
190.What is GitHub Sponsors?
Easy
191.What is Dependabot?
Easy
192.What is Secret Scanning?
Medium
193.What is CodeQL?
Hard
194.What are GitHub environment secrets?
Hard
195.What is the GitHub advisory database?
Medium
196.What are GitHub organizations vs personal accounts for security?
Medium
197.What is the difference between Git cherry-pick and merge?