AWS Certified Data Engineer – Associate (DEA-C01) — Question 135

Two developers are working on separate application releases. The developers have created feature branches named Branch A and Branch B by using a GitHub repository’s master branch as the source.

The developer for Branch A deployed code to the production system. The code for Branch B will merge into a master branch in the following week’s scheduled application release.

Which command should the developer for Branch B run before the developer raises a pull request to the master branch?

Answer options

Correct answer: C

Explanation

The correct command for the developer of Branch B to run is 'git rebase master', as it allows them to apply their changes on top of the latest changes from the master branch, ensuring compatibility before the pull request. The other options do not prepare the branch correctly for merging; 'git pull master' would just fetch changes, while 'git fetch -b master' is not a valid command and 'git diff branchB master git commit -m' does not merge changes.