exam questions

Exam 350-901 All Questions

View all questions & answers for the 350-901 exam

Exam 350-901 topic 1 question 383 discussion

Actual exam question from Cisco's 350-901
Question #: 383
Topic #: 1
[All 350-901 Questions]

A developer checks out a branch named feat23 from a Git repository. The developer receives this error after attempting to switch to a branch named feat89:

Error: You have local changes to 'feat23'; not switching branches.

Which command switches to branch feat89?

  • A. git checkout -r feat89
  • B. git mv feat89
  • C. git checkout -m feat89
  • D. git merge feat89
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
1a63556
Highly Voted 10 months, 4 weeks ago
Selected Answer: C
C. git checkout -m feat89 The error message indicates that there are uncommitted changes in the current branch (feat23). Normally, Git prevents switching branches in this situation to avoid potential conflicts. To force Git to switch to another branch despite the uncommitted changes, the developer can use the -m or --merge option with the git checkout command. This tries to perform a three-way merge between the current changes, the changes in the branch that is being checked out (feat89), and the common ancestor of the two. So, git checkout -m feat89 should allow the developer to switch to the feat89 branch.
upvoted 6 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago