nerdexam
Cisco

200-901 · Question #294

Refer to the exhibit. What does the command marked (2) do when it is run?

The correct answer is C. It deletes the "test" branch. The command shown in the exhibit is 'git branch -D test'. The '-D' flag (uppercase) is a force-delete option in Git. It deletes the specified branch ('test') immediately, regardless of whether the branch has been merged into another branch. This is distinct from '-d'…

Software Development and Design

Question

Refer to the exhibit. What does the command marked (2) do when it is run?

Exhibit

200-901 question #294 exhibit

Options

  • AIt duplicates the "test" branch.
  • BIt deletes the "test" branch only if a new branch is created.
  • CIt deletes the "test" branch.
  • DIt does not delete the branch until it is merged.

How the community answered

(56 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    91% (51)
  • D
    5% (3)

Explanation

The command shown in the exhibit is 'git branch -D test'. The '-D' flag (uppercase) is a force-delete option in Git. It deletes the specified branch ('test') immediately, regardless of whether the branch has been merged into another branch. This is distinct from '-d' (lowercase), which is a safe delete that refuses to delete a branch if it contains commits not yet merged. Answer D describes the behavior of 'git branch -d' (safe delete), not '-D'. Answer B is incorrect - branch deletion does not depend on creating a new branch. Answer A is incorrect - '-D' deletes, not duplicates. Use '-D' when you are certain you want to remove the branch regardless of merge status.

Topics

#Git#Version Control#Branch Management

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice