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

1.What is Version Control?

2.Why use Version Control?

3.What is Git?

4.What is the difference between Git and GitHub?

5.What is the difference between Git and other VCS (SVN, Mercurial)?

6.How do you install Git locally?

7.What is git init?

8.What is git config?

9.What is the difference between local and global config?

10.How do you set username and email in Git?

11.What is a Git repository?

12.What is the difference between local and remote repository?

13.What is Working Directory?

14.What is Staging Area (Index)?

15.What is the .git folder?

16.What is git status?

17.What is git add? What does it do?

18.What is the difference between git add . and git add -A?

19.What is git commit?

20.What is the difference between git commit -m and git commit -am?

21.What is git log? What options can you use with it?

22.What is git diff?

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

24.What is .gitignore? How does it work?

25.How do you ignore files that are already tracked?

26.What is git rm?

27.What is the difference between git rm and rm?

28.What is git mv?

29.How do you view commit history?

30.What is HEAD in Git?

31.What is a branch in Git?

32.Why do we use branches?

33.What is the default branch name?

34.What is git branch?

35.How do you create a new branch?

36.What is git checkout?

37.What is the difference between git checkout and git switch?

38.How do you create and switch to a branch in one command?

39.What is git branch -d vs git branch -D?

40.How do you rename a branch?

41.How do you delete a branch?

42.What is git merge?

43.What are the types of merges (Fast-forward, 3-way merge)?

44.What is a merge conflict?

45.How do you resolve merge conflicts?

46.What is a remote repository?

47.What is git remote?

48.How do you add a remote repository?

49.What is origin in Git?

50.What is git clone?

51.What is the difference between cloning and forking?

52.What is git fetch?

53.What is git pull?

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

55.What is git push?

56.What is git push -u origin main? What does -u do?

57.What is git push --force? When should you use it?

58.What is upstream branch?

59.How do you set upstream branch?

60.How do you delete a remote branch?

61.What is GitHub?

62.How do you create a repository on GitHub?

63.What is the difference between public and private repositories?

64.What is a README file? Why is it important?

65.What is Markdown?

66.How do you write a good README?

67.What are GitHub Issues?

68.What is a Pull Request (PR)?

69.What is the difference between Pull Request and Merge Request?

70.How do you create a Pull Request?

71.What are PR guidelines and best practices?

72.What is code review?

73.How do you label issues and PRs?

74.What is forking?

75.What is the difference between fork and clone?

76.How do you fork a repository?

77.What is a PR from a fork?

78.How do you sync a forked repository?

79.What are collaborators in GitHub?

80.How do you add collaborators to a repository?

81.What are mentions (@username)?

82.What are reactions in GitHub?

83.What is commenting on PRs and commits?

84.What are saved replies?

85.What are GitHub Discussions?

86.What is branch naming convention?

87.What are commit message best practices?

88.What is conventional commits?

89.What is Fast-Forward merge?

90.What is Non-Fast-Forward merge?

91.What is git merge --no-ff?

92.What is Squash merge?

93.What is Rebase?

94.What is the difference between merge and rebase?

95.When should you use rebase vs merge?

96.What is Cherry-picking commits?

97.What is handling merge conflicts?

98.What is merge conflict resolution strategies?

99.What is git stash?

100.When do you use git stash?

101.What is git stash pop vs git stash apply?

102.What is git stash list?

103.What is Detached HEAD state?

104.What is git checkout <commit-hash>?

105.What is git log --oneline?

106.What is git log --graph?

107.What is Linear vs Non-Linear history?

108.What is git reset?

109.What are the types of reset: --soft, --mixed, --hard?

110.What is the difference between git reset --soft and --hard?

111.What is git revert?

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

113.When should you use reset vs revert?

114.What is git checkout -- <file>?

115.What is git restore?

116.How do you undo the last commit?

117.How do you undo changes in working directory?

118.How do you undo staged changes?

119.What is git clean?

120.What is the difference between git clean -n and git clean -f?

121.How do you view differences between commits?

122.How do you view differences between branches?

123.What is git diff HEAD?

124.How do you view changes in a specific file?

125.What is git commit --amend?

126.When do you use git commit --amend?

127.What is git rebase -i (interactive rebase)?

128.What is git filter-branch?

129.What is git push --force-with-lease?

130.What is rewriting commit history?

131.Why is rewriting history dangerous in shared branches?

132.What are GitHub Projects?

133.What is project planning on GitHub?

134.What are Kanban boards?

135.What are roadmaps in GitHub Projects?

136.What are automations in GitHub Projects?

137.What are GitHub Organizations?

138.What is the difference between user account and organization?

139.What are teams within organizations?

140.How do you add collaborators and members?

141.What are GitHub Actions?

142.What is CI/CD?

143.What is a workflow in GitHub Actions?

144.What is YAML syntax for workflows?

145.What are workflow triggers (push, pull_request, schedule)?

146.What are scheduled workflows (cron jobs)?

147.What are workflow runners?

148.What is workflow context?

149.What are secrets and environment variables?

150.What are GitHub Actions use cases?

151.What are client-side hooks vs server-side hooks?

152.What is caching dependencies in workflows?

153.What are storing artifacts in workflows?

154.What is workflow status?

155.What are marketplace actions?

156.What is GitHub CLI?

157.How do you install and set up GitHub CLI?

158.How do you manage repositories using CLI?

159.How do you manage issues using CLI?

160.How do you manage pull requests using CLI?

161.What is GitHub REST API?

162.What is GitHub GraphQL API?

163.What is the difference between REST and GraphQL API?

164.What is Git Reflog?

165.What is Git Bisect?

166.What is Git Worktree?

167.What is Git Attributes?

168.What is Git LFS (Large File Storage)?

169.When do you need Git LFS?

170.What are Git Hooks?

171.What are client-side hooks (pre-commit, post-commit, pre-push)?

172.What are server-side hooks?

173.What are submodules in Git?

174.What is the difference between submodules and subtrees?

175.How do you add and update submodules?

176.What are GitHub Pages?

177.How do you deploy a static website on GitHub Pages?

178.What are custom domains in GitHub Pages?

179.What are static site generators (Jekyll)?

180.What is GitHub Copilot?

181.What are GitHub Gists?

182.What are GitHub Packages?

183.What is GitHub Codespaces?

184.What is GitHub Marketplace?

185.What is GitHub Education?

186.What is Student Developer Pack?

187.What is GitHub Classroom?

188.What is Campus Program?

189.What is GitHub Security?

190.What is GitHub Sponsors?

191.What is Dependabot?

192.What is Secret Scanning?

193.What is CodeQL?

194.What are GitHub environment secrets?

195.What is the GitHub advisory database?

196.What are GitHub organizations vs personal accounts for security?

197.What is the difference between Git cherry-pick and merge?

198.How do you undo a git rebase?

199.What is git blame?

200.What is a bare repository?