Question 1 of 30
A software development team is collaborating on a project using Git for version control. They have a main branch called `main` and a feature branch called `feature-xyz`. After completing the feature, they want to merge `feature-xyz` into `main`. However, they notice that there are some changes in `main` that were made after `feature-xyz` was created. What is the best approach for the team to ensure that the `feature-xyz` branch is up to date with the latest changes in `main` before merging, and what command should they use to achieve this?
They should first switch to the `feature-xyz` branch and run `git merge main` to incorporate the latest changes from `main` into `feature-xyz`.
They should delete the `feature-xyz` branch and recreate it from `main` to ensure it has the latest changes.
They should run `git rebase main` while on the `main` branch to apply the changes from `feature-xyz` onto the latest `main`.
They should run `git pull origin main` while on the `main` branch to update `main` and then merge `feature-xyz` into `main`.

Preparing for Microsoft 98-375 HTML5 App 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