Git MCQ Test: Git MCQs - Practice Questions
1. Explain the purpose of 'git cherry-pick' and when it is commonly used.
2. What is the purpose of 'git stash'?
3. Explain the use case and potential issues related to 'git rerere forget' in Git.
4. Explain the concept of 'git worktree remove' and when it might be useful in Git workspace management.
5. Explain the concept of 'git fetch --prune' and its significance in Git.
6. Explain the purpose and potential risks of 'git gc --prune' in Git repository maintenance.
7. How do you discard changes in a Git repository?
8. What does 'git remote -v' show?
9. How does 'git worktree add' enhance workspace management in Git, and when might it be beneficial?
10. Explain the concept of 'git filter-branch' and its applications in Git history manipulation.
11. Explain the concept of 'git bundle verify' and how it contributes to repository integrity.
12. What is 'git revert -m' used for, and in what scenario might it be applicable?
13. How does 'git bundle' work, and in what scenarios might it be beneficial?
14. How do you switch to the previous branch in Git?
15. What is 'git gc' used for, and how does it impact Git repository maintenance?
16. What is the purpose of 'git init'?
17. What is 'git reflog,' and how can it be helpful in Git?
18. What is the purpose of 'git fetch'?
19. What is 'git reflog show' used for, and how can it be beneficial in Git?
20. How do you revert a Git commit?
21. Explain the purpose of 'git push --force' and when it should be used with caution.
22. Explain the purpose and potential risks of 'git reflog expire --expire=now' in Git.
23. How do you remove untracked files in Git?
24. What is 'git remote' and how is it used in a Git repository?
25. Explain the purpose of 'git tag' and how it can be useful in version control.
26. How do you undo the last Git commit?
27. Explain the difference between 'git fetch' and 'git pull.'
28. What is 'git rebase --onto' used for, and provide a scenario where it might be beneficial?
29. How do you create a new branch without switching to it?
30. What is 'git worktree' used for, and how can it be beneficial in a Git repository?
31. What is the purpose and potential risks of 'git rebase --autostash'?
32. How do you rename a Git branch?
33. Explain the concept of 'git hooks' and provide an example use case.
34. Which Git command is used to create a new branch?
35. What does 'git checkout' do?
36. What does 'git merge' do?
37. Explain the benefits of using 'git rebase' over 'git merge.'
38. Which command is used to create a new branch and switch to it?
39. What does 'git pull' do?
40. What is 'git worktree lock' used for, and how can it be beneficial in Git workspace management?