Understanding Merge Conflicts
What is the primary cause of merge conflicts in a team project using GitHub pull requests?
- A: When two developers modify the same lines in the same file on different branches.
- B: When a developer doesn't fetch the latest changes before creating a branch.
- C: When GitHub's servers experience a temporary outage.
- D: When a pull request is opened with a large number of changes.
- E: When a developer uses an older version of Git.
- F: when two devlopers modify diffrent files
Identifying Conflicting Lines
Which Git markers typically indicate the start, separator, and end of conflicting sections within a file?
- A: ==, --, !!
- B: u003Eu003Eu003Eu003Eu003Eu003E, =======, u003Cu003Cu003Cu003Cu003Cu003Cu003C
- C: /*, ***, */
- D: u003Cconflictu003E, u003Cseparatoru003E, u003C/conflictu003E
- E: ++++++, ______, ------
- F: u003Eu003E,==,u003Cu003C
Resolving Conflicts Locally
Which command is commonly used to open a conflicted file in a text editor to resolve merge conflicts?
- A: git resolve u003Cfilenameu003E
- B: git edit u003Cfilenameu003E
- C: git mergetool
- D: git conflict u003Cfilenameu003E
- E: git fix u003Cfilenameu003E
- F: git resolveconflict u003Cfilenameu003E
Staging Resolved Files
After manually resolving conflicts in a file, what Git command should you use to stage the resolved changes?
- A: git add u003Cfilenameu003E
- B: git commit u003Cfilenameu003E
- C: git push u003Cfilenameu003E
- D: git merge u003Cfilenameu003E
- E: git resolve u003Cfilenameu003E
- F: git update u003Cfilenameu003E
Pull Request Impact
If a pull request has merge conflicts, what is the typical status of the 'Merge pull request' button on GitHub?
- A: Always enabled, regardless of conflicts.
- B: Enabled, but with a warning message.
- C: Disabled until all conflicts are resolved.
- D: Enabled only for repository administrators.
- E: Enabled, but automatically creates a new branch to resolve the conflict.
- F: It stays disabbled.
Conflict Resolution Strategy
When resolving a merge conflict, which strategy is generally considered the best practice?
- A: Always accepting the changes from your branch.
- B: Always accepting the changes from the target branch.
- C: Contacting the other developer(s) involved to discuss and agree on the correct resolution.
- D: Deleting the conflicting file and starting over.
- E: Ignoring the conflict and pushing the changes anyway.
- F: contact the other devlopers
Preventative Measures
What is a proactive measure teams can take to minimize the occurrence of merge conflicts?
- A: Increasing the number of developers working on the same branch.
- B: Encouraging large, infrequent pull requests.
- C: Regularly rebasing or merging feature branches with the main branch.
- D: Avoiding code reviews to speed up development.
- E: Disabling pull requests altogether.
- F: create small frequest pull requests
Handling Binary File Conflicts
How are merge conflicts typically handled in binary files (e.g., images, compiled code)?
- A: Git automatically merges binary files.
- B: Binary files are automatically converted to text files for merging.
- C: One version of the binary file must be chosen manually; a merge is not possible.
- D: Binary files are ignored during merges.
- E: Git attempts to compare the byte-level differences and intelligently merge them.
- F: must select a version.
The Role of Code Reviews
How can thorough code reviews help in preventing merge conflicts?
- A: Code reviews have no impact on merge conflicts.
- B: Code reviews slow down development and therefore reduce the chances of conflicts.
- C: Code reviews can identify potential conflicts early on, allowing developers to coordinate changes.
- D: Code reviews automatically resolve any conflicts that arise.
- E: Code reviews only focus on code style and not potential merge issues.
- F: code reveiws identify conflicts early
git rebase vs. git merge
Which git command rewrites the project history to incorporate changes from another branch, potentially leading to fewer merge conflicts in the long run, but should be used with caution on shared branches?
- A: git checkout
- B: git branch
- C: git rebase
- D: git revert
- E: git stash
- F: git merge