Question 1 of 30
In a collaborative software development project, a team is using Git for version control. The team has a main branch called `main` and a feature branch called `feature-xyz`. After several commits on `feature-xyz`, the team decides to merge these changes back into the `main` branch. However, during the merge process, they encounter a conflict due to changes made in both branches to the same line of code. What is the best approach for resolving this conflict while ensuring that the history of both branches is preserved?
Use a three-way merge to resolve the conflict and commit the changes to the `main` branch.
Delete the `feature-xyz` branch and reapply the changes manually to the `main` branch.
Force push the `feature-xyz` branch to the `main` branch, overwriting the existing history.
Rebase the `feature-xyz` branch onto the `main` branch before merging to avoid conflicts.

Preparing for Microsoft 98-361 Software Development Fundamentals? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free