ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 329 - XK0-005 discussion

Report
Export

A DevOps engineer is working on a local copy of a Git repository. The engineer would like to switch from the main branch to the staging branch but notices the staging branch does not exist. Which of the following Git commands should the engineer use to perform this task?

A.

git branch -m staging

Answers
A.

git branch -m staging

B.

git commit -m staging

Answers
B.

git commit -m staging

C.

git status -b staging

Answers
C.

git status -b staging

D.

git checkout -b staging

Answers
D.

git checkout -b staging

Suggested answer: D

Explanation:

The git checkout -b staging command creates a new branch called staging and switches to it. This is useful when you want to create a new branch locally and begin working on it. The -b flag is used to create the branch if it doesn't exist.

asked 09/10/2024
Thomas Spring
28 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first