CiscoCisco
350-901 · Question #77
350-901 Question #77: Real Exam Question with Answer & Explanation
The correct answer is C: git checkout -b BUG FIX RELEASE. To create a new branch from an existing one in Git, the git checkout -b <new-branch-name> <starting-point-branch> command is used.
Software Development and Design
Question
A developer plans to create a new bugfix branch to fix a bug that was found on the release branch. Which command completes the task?
Options
- Agit checkout -b RELEASE BUGFIX
- Bgit checkout -t BUGFIX RELEASE
- Cgit checkout -b BUG FIX RELEASE
- Dgit checkout -t RELEASE BUGFIX
Explanation
To create a new branch from an existing one in Git, the git checkout -b <new-branch-name> <starting-point-branch> command is used.
Common mistakes.
- A. The arguments are in the wrong order;
RELEASEis given as the new branch name andBUGFIXas the starting point, which is incorrect. - B. The
-t(or --track) option is used to set up tracking for a remote branch, not to create a new local branch from another local branch. - D. Similar to B,
-tis for tracking remote branches and the order of arguments is incorrect for creating a local branch from another.
Concept tested. Git branch creation from an existing branch
Reference. https://git-scm.com/docs/git-checkout#_create_new_branches
Topics
#Git branching#Version control#Software development workflow
Community Discussion
No community discussion yet for this question.