Skip to content

Latest commit

 

History

History
92 lines (45 loc) · 2.33 KB

Git interview questions.md

File metadata and controls

92 lines (45 loc) · 2.33 KB

Basic GIT Interview Questions

  1. What is a version control system (VCS)?

  2. What is a git repository?

  3. What does git clone do?

  4. What does the command git config do?

  5. Can you explain head in terms of git and also tell the number of heads that can be

present in a repository?

  1. What is a conflict?

  2. What is the functionality of git ls-tree?

  3. What does git status command do?

  4. Define “Index”.

  5. What does git add command do?

Intermediate GIT Interview Questions

  1. Why is it considered to be easy to work on Git?

  2. How will you create a git repository?

  3. Tell me something about git stash?

  4. What is the command used to delete a branch?

  5. What differentiates between the commands git remote and git clone?

  6. What does git stash apply command do?

  7. Differentiate between git pull and git fetch.

  8. Can you give differences between “pull request” and “branch”?

  9. Why do we not call git “pull request” as “push request”?

  10. Can you tell the difference between Git and GitHub?

  11. What do the git diff and git status commands do?

  12. What has to be run to squash multiple commits (last N) into a single commit?

  13. How would you recover a branch that has already pushed changes in the central

repository but has been accidentally deleted from every team member’s local

machines?

  1. Can you tell something about git reflog?

  2. What consists of a commit object?

  3. Explain the levels in git config and how can you configure values using them?

  4. What is a detached HEAD and what causes this and how to avoid this?

  5. What does git annotate command do?

  6. What is the difference between git stash apply vs git stash pop command?

Advanced GIT Interview Questions

  1. What command helps us know the list of branches merged to master?

  2. How will you resolve conflict in Git?

  3. What is best advisable step in cases of broken commit: Create an additional

commit OR amend an existing commit?

  1. How to revert a bad commit which is already pushed?

  2. What is the functionality of “git cherry-pick” command?

  3. Explain steps involved in removing a file from git index without removing from

the local file system?

  1. What are the factors involved in considering which command to choose among:

git merge and git rebase?