CompTIA DataX (CNX-001) — Question 26
A cloud architect needs to change the network configuration at a company that uses GitOps to document and implement network changes. The Git repository uses main as the default branch, and the main branch is protected. Which of the following should the architect do after cloning the repository?
Answer options
- A. Use the main branch to make and commit the changes back to the remote repository.
- B. Create a new branch for the change, then create a pull request including the changes.
- C. Check out the development branch, then perform and commit the changes back to the remote repository.
- D. Rebase the remote main branch after making the changes to implement.
Correct answer: B
Explanation
The correct approach is to create a new branch for the changes and submit a pull request, as this adheres to best practices in GitOps, especially when the main branch is protected. Making changes directly to the main branch or to another branch without pull requests undermines the control and review process. Rebasing the main branch is not applicable here since you should not modify the protected branch directly.