Git , GitHub And CLI

Git , GitHub And CLI

University

30 Qs

quiz-placeholder

Similar activities

MIDTERM QUIZ IN WEB DEV 101

MIDTERM QUIZ IN WEB DEV 101

University

25 Qs

WEB TECH

WEB TECH

University

25 Qs

[KM] [FEJS2] Chapter 1 - Final Quiz

[KM] [FEJS2] Chapter 1 - Final Quiz

University

25 Qs

Pre-Assessment quiz_Back end + Mongo.db_Gokak

Pre-Assessment quiz_Back end + Mongo.db_Gokak

University

33 Qs

PHP-предметная олимпиада по программированию

PHP-предметная олимпиада по программированию

University

30 Qs

HTML Quiz : Batch1

HTML Quiz : Batch1

University

25 Qs

HTML QUIZ 😎

HTML QUIZ 😎

University

25 Qs

Test Evaluasi 1-Web Dasar

Test Evaluasi 1-Web Dasar

University

25 Qs

Git , GitHub And CLI

Git , GitHub And CLI

Assessment

Quiz

Computers

University

Medium

Created by

Shashwat Mahendra

Used 7+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the command "git init" do?

  • Initializes a new GitHub repository

  • Creates a new Git repository in the current directory

  • Clones an existing repository

  • Commits changes to the repository

E)None of the above

Answer explanation

git init initializes a new Git repository in the current directory by creating a .git subdirectory that contains all the necessary metadata and object database.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you switch to a different branch?

  • A) git branch <branch-name>

  • B) git checkout <branch-name>

  • C) git switch <branch-name>

  • D) git jump <branch-name>

Answer explanation

git checkout <branch-name> switches the active branch to the specified branch.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary purpose of git clone?

  • Copying files between branches

  • Creating a duplicate of a repository from a remote server

  • Merging branches

  • Initializing a new repository

E)None of the above

Answer explanation

git clone is used to create a local copy of a remote repository. It downloads the entire repository, including all files, branches, and history.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which command stages changes for the next commit?

  • git commit

  • git push

  • git add

  • git pull

E)None of the above

Answer explanation

git add stages changes by adding files or changes to the staging area, preparing them to be included in the next commit.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does git status display?

  • A) The current branch

  • B) Changes staged, unstaged, and untracked

  • C) Remote repository status

  • D) The commit history

E)None of the above

Answer explanation

git status shows the state of the working directory and the staging area, including changes that are staged for commit, unstaged changes, and untracked files.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you view the commit history in Git?

  • A) git status

  • B) git log

  • C) git history

  • D) git show

E)None of the above

Answer explanation

git log displays the commit history for the current branch, including commit hashes, authors, dates, and commit messages.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of git pull?

  • A) Uploads local commits to the remote repository

  • B) Downloads changes and integrates them into the current branch

  • C) Deletes the current branch

  • D) Creates a new branch

E)None of the above

Answer explanation

git pull is a combination of git fetch and git merge, which downloads changes from a remote repository and merges them into the current branch.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?