Git , GitHub And CLI

Git , GitHub And CLI

University

30 Qs

quiz-placeholder

Similar activities

CCC30 - Chapter 8 - Digital Financial Services

CCC30 - Chapter 8 - Digital Financial Services

University

25 Qs

Adapter Cards

Adapter Cards

University

30 Qs

PEGAMBILAN KEPUTUSAN MANAJEMEN

PEGAMBILAN KEPUTUSAN MANAJEMEN

University

25 Qs

TRẮC NGHIỆM TIN 4 BÀI 2: GÕ PHÍM ĐÚNG CÁCH

TRẮC NGHIỆM TIN 4 BÀI 2: GÕ PHÍM ĐÚNG CÁCH

5th Grade - University

25 Qs

Pag-ahon

Pag-ahon

University

25 Qs

Frog Vle

Frog Vle

University

25 Qs

PAS Kelas 7 Ganjil

PAS Kelas 7 Ganjil

7th Grade - University

25 Qs

Analysis Algorithms Introduction

Analysis Algorithms Introduction

University

26 Qs

Git , GitHub And CLI

Git , GitHub And CLI

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Shashwat Mahendra

Used 7+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers