200-901 exam dumps

200-901 practice question 30 of 204

Cisco DevNet Associate. Associate level, Cisco. Free question with the correct answer and a full explanation.

200-901 Question 30

Single answer

A development team is managing a Git repository for a new project. They want to create a separate branch for implementing a new feature, while ensuring that the main branch remains stable and unaffected by ongoing work. Once the feature is complete, it should be merged back into the main branch. What is the best approach to achieve this?

  1. A

    Create a new branch from the main branch and work on the feature in the new branch.

  2. B

    Directly implement the feature on the main branch and push the changes to the remote repository.

  3. C

    Fork the entire repository, implement the feature, and then replace the main branch with the forked repository.

  4. D

    Delete the main branch, create a new branch for the feature, and then recreate the main branch after the feature is complete.

Show answer and explanation

Correct answer: A

Explanation

In Git, branching is a common practice used to isolate work on new features, bug fixes, or experiments without impacting the main branch. Creating a new branch allows developers to work on changes independently and merge them back when ready. This ensures the main branch remains stable and deployable, aligning with best practices for version control.

  • A. Correct.

    This is the correct approach. Creating a new branch from the main branch allows developers to work on the feature independently without affecting the stability of the main branch. Once the feature is complete, it can be merged back into the main branch.

  • B. Incorrect.

    This approach is not recommended because making changes directly on the main branch can introduce instability and bugs, especially if the feature is incomplete or experimental.

  • C. Incorrect.

    Forking the entire repository is unnecessary for this scenario. A fork is typically used for creating a completely independent copy of the repository, which is not required here.

  • D. Incorrect.

    Deleting the main branch is a bad practice and could lead to loss of critical code. Additionally, recreating it after the feature is complete is not a standard or efficient workflow.

Timed practice exam

Take a 200-901 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam