A teammate clones a Git repository and can inspect its existing commit history before connecting to the shared remote. True or false?
4 Version Control and Team Collaboration Online Quiz Questions
Use this free practice quiz with 20 questions to review 4 Version Control and Team Collaboration, test your knowledge, and prepare for your next test or exam.
A developer has edited three files but wants the next commit to include changes from only one of them. Which Git area lets the developer select those changes?
- A
The remote
- B
The staging area
- C
The commit history
- D
The main branch
A developer has made local commits and wants to send them to the shared remote repository. What Git command should the developer use?
In Git, a movable name for a line of development is a .
A Git merge conflict necessarily proves that at least one contributor made a mistake. True or false?
- A
True
- B
False
A developer wants teammates to inspect a branch’s changes, discuss them, and request revisions before integration. Which tool or collaboration mechanism best fits this purpose?
- A
A merge conflict: it automatically fixes overlapping edits between branches.
- B
A remote: it replaces the repository’s commit history with a summary.
- C
A pull request: it proposes merging a branch and provides a place to review and discuss the change.
- D
A branch: it prevents contributors from changing the branch after review begins.
A teammate is preparing several commits for a shared project. Select all practices that make the commits easier for others to understand and review.
- A
Keep a commit focused on a coherent change.
- B
Combine unrelated changes into one large commit whenever possible.
- C
Use a clear message to describe the change.
- D
Leave the purpose of each commit unexplained so reviewers can infer it.
If the histories have not diverged, Git may move the target branch pointer without creating a merge commit. This is called a merge.
A contributor wants to obtain updates from a remote repository. What Git command should they use?
Two branches have each gained new commits since they diverged. What may Git do when merging one branch into the other?
- A
Git always discards the target branch's commits.
- B
Git combines the histories and may create a merge commit.
- C
Git automatically chooses one branch and deletes the other.
- D
Git cannot merge branches once both have new commits.
A merge reports overlapping edits in a file. Select all steps that are appropriate for resolving the conflict before completing the merge.
- A
Inspect the competing versions of the edits.
- B
Decide what the combined result should be.
- C
Assume the newest edit is correct and discard the other without review.
- D
Remove conflict markers and run relevant checks before completing the merge.
A developer makes a focused fix on a separate branch. The team requests a revision during review, and a merge conflict appears before integration. Describe the steps the developer should take from preparing the branch through completing the merge.
At the start of the example workflow, a developer needs to update the local copy of the main branch. Which command sequence does the workflow use?
- A
Run
git push, thengit switch main. - B
Run
git commit, thengit fetch. - C
Run
git switch main, thengit pull. - D
Run
git merge, thengit add.
Every team must use the same branch-naming rules, required reviews, automated checks, and merge style. True or false?
- A
True
- B
False
You have edited two files, but only one file’s change is ready to record. Which Git area lets you select that change for the next commit?
- A
The working tree: it records every change automatically in a commit.
- B
The staging area: it lets you select which changes to include in the next commit.
- C
The remote: it combines two branches.
- D
The commit: it downloads changes from a remote repository.
Which Git command obtains updates from a remote repository?
A developer is starting a focused bug fix and wants to keep the main branch undisturbed while working. What should they do?
- A
Edit directly on the remote repository's main branch
- B
Create a merge conflict intentionally
- C
Create a short-lived branch for the feature
- D
Delete the main branch and recreate it later
What is the name for a proposal to merge one branch into another that provides a place for discussion and review?
Two teams use different approval requirements and merge styles. Which conclusion is consistent with the described collaboration practices?
- A
Every team must use the same approval count and merge style
- B
Different teams can set different review and merge policies
- C
Git requires every branch name to follow one fixed pattern
- D
Automated checks are prohibited if a team requires review
Which statement best explains why a Git clone can provide access to a repository's history locally?
- A
Each clone contains the repository's history
- B
A clone contains only the latest file versions and no history
- C
A repository's history exists only on its remote
- D
Every commit must be made directly on the shared remote