Which of the following statement would create branch named as ‘sanfoundry’?

git checkout -b sanfoundry
git checkout -c sanfoundry
git check -b sanfoundry
none of the mentioned

The correct answer is: A. git checkout -b sanfoundry

The git checkout command is used to switch between branches. The -b flag tells git to create a new branch. The sanfoundry argument is the name of the new branch.

The git checkout -c command is used to create a new commit on the current branch. The sanfoundry argument is the name of the new commit.

The git check command is used to check out the current branch. It does not create a new branch or commit.

Therefore, the only command that creates a branch named as ‘sanfoundry’ is git checkout -b sanfoundry.

Exit mobile version