Quiz: Module 06: Version Control with Git
Test your understanding of the concepts covered in this module.
50 questions · 0/50 answered
Question 1. What is the primary purpose of a version control system?
Question 2. Which of the following is NOT a benefit of using version control?
Question 3. True or False: Without version control, the most common way to track changes is to copy files into another directory (for example, `project-v1`, `project-v2`), which is simple and error-free.
Question 4. What type of version control system is Git?
Question 5. What is the key difference between a centralized version control system (like Subversion) and a distributed version control system (like Git)?
Question 6. Which of the following best describes a Git repository?
Question 7. What is the difference between a local repository and a remote repository?
Question 8. Which command creates a new, empty Git repository in the current directory?
Question 9. What does the `git clone` command do?
Question 10. True or False: When you run `git clone`, you get a full copy of the repository including its entire commit history.
Question 11. What are the three main areas (states) that files move through in a Git workflow?
Question 12. What is the purpose of the staging area (also called the index) in Git?
Question 13. Which command adds a specific file to the staging area?
Question 14. What does `git add .` do?
Question 15. True or False: Once you stage a file with `git add`, the changes are permanently saved in the repository.
Question 16. Which command saves your staged changes as a new snapshot in the repository?
Question 17. What is a commit in Git?
Question 18. Which of the following is a good commit message?
Question 19. True or False: Each Git commit is identified by a unique SHA-1 hash (a long string of letters and numbers like `a1b2c3d4...`).
Question 20. What does the `git status` command show you?
Question 21. Which command displays the commit history of a repository?
Question 22. What does `git log --oneline` do?
Question 23. In your own words, describe the three-step workflow of making changes in Git (modify, stage, commit).
Free-response questions are self-assessed. Compare your answer with the sample response.
Question 24. What is a branch in Git?
Question 25. What is the name of the default branch in most Git repositories?
Question 26. Which command creates a new branch called `feature/login`?
Question 27. Which command switches you to an existing branch called `feature/login`?
Question 28. What does `git checkout -b feature/signup` do?
Question 29. True or False: When you create a new branch, it starts as an exact copy of the branch you were on when you created it.
Question 30. What does the `git merge` command do?
Question 31. You are on the `main` branch and want to merge changes from `feature/login` into `main`. Which command do you run?
Question 32. What is a merge conflict?
Question 33. When a merge conflict occurs, what does Git add to the conflicting file to show you the differences?
Question 34. True or False: To resolve a merge conflict, you must manually edit the file to choose which changes to keep, remove the conflict markers, and then stage and commit the result.
Question 35. What does the `git remote` command do?
Question 36. What does the command `git remote add origin https://github.com/user/repo.git` do?
Question 37. Which command uploads your local commits to a remote repository?
Question 38. What is the difference between `git pull` and `git fetch`?
Question 39. True or False: `git push` sends your local commits to the remote repository, while `git pull` downloads commits from the remote repository and merges them into your local branch.
Question 40. Which of the following is a popular web-based platform for hosting Git repositories?
Question 41. Which of the following features do platforms like GitHub and GitLab provide? (Select THREE.)Select multiple
Question 42. What is a pull request (called a merge request on GitLab)?
Question 43. What is the purpose of a `.gitignore` file?
Question 44. Which of the following should typically be listed in a `.gitignore` file? (Select THREE.)Select multiple
Question 45. True or False: If a file is already being tracked by Git, adding it to `.gitignore` will immediately stop Git from tracking it.
Question 46. What is the feature branch workflow?
Question 47. In the feature branch workflow, what is the typical sequence of steps to contribute a new feature?
Question 48. A developer runs `git status` and sees a file listed under "Changes not staged for commit." What does this mean?
Question 49. A team of three developers is working on the same project. Developer A and Developer B both modify the same line in `app.js` on different branches. When Developer B tries to merge their branch into `main` (which already contains Developer A's changes), what happens?
Question 50. In your own words, explain why version control with Git is important for software development teams. Include at least two benefits.
Free-response questions are self-assessed. Compare your answer with the sample response.