Heads up: opening this section reveals every question, every option, and the correct answer for this round. If you came here to play, scroll up and hit Play first.
Question 1: Which area in Git is used to prepare changes before they are officially committed?
- Working Directory
- Local Repository
- Staging Area
- Remote Repository
Answer: C. Staging Area
Explanation: The Staging Area, also known as the index, acts as a buffer where you prepare and organize your changes before finalizing them in a commit.
Question 2: Which command is used to move changes from the Working Directory to the Staging Area?
- git push
- git commit
- git fetch
- git add
Answer: D. git add
Explanation: The git add command is the standard way to stage changes, effectively telling Git that you want to include these updates in the next commit.
Question 3: Where are permanent snapshots of your project history stored?
- Repository
- Staging Area
- Terminal
- Working Directory
Answer: A. Repository
Explanation: The Repository is the core component of Git that stores the permanent history of your project, including all committed snapshots and metadata.
Question 4: Which command saves staged changes into the local Repository?
- git pull
- git commit
- git merge
- git fetch
Answer: B. git commit
Explanation: The git commit command takes the files currently in the Staging Area and records them as a new, permanent snapshot in the local project history.
Question 5: Which command transfers local commits to a remote Repository?
- git merge
- git fetch
- git add
- git push
Answer: D. git push
Explanation: The git push command is used to upload your local repository's commit history to a remote server, making your changes available to others.
Question 6: Which command downloads changes from a remote Repository without merging them?
- git merge
- git fetch
- git push
- git pull
Answer: B. git fetch
Explanation: The git fetch command retrieves data from a remote repository but does not automatically integrate it into your current working branch.
Question 7: What is the primary purpose of the 'git merge' command?
- To push to remote
- To delete branches
- To combine branch histories
- To stage files
Answer: C. To combine branch histories
Explanation: The git merge command is used to integrate changes from one branch into another, combining their histories into the current working branch.
Question 8: Which command integrates changes by rewriting the commit history?
- git fetch
- git push
- git rebase
- git add
Answer: C. git rebase
Explanation: The git rebase command allows you to move or combine a sequence of commits to a new base commit, effectively rewriting the project history.
Question 9: What is the area where developers actively make changes to files?
- Commit History
- Working Directory
- Staging Area
- Remote Repository
Answer: B. Working Directory
Explanation: The Working Directory is the actual folder on your computer where you edit, create, and delete files before they are staged or committed.
Question 10: What defines a Git workflow?
- A set of collaboration rules
- A text editor
- A hardware requirement
- A cloud storage limit
Answer: A. A set of collaboration rules
Explanation: A Git workflow is a set of established rules and best practices that define how a team collaborates by branching, merging, and delivering code.