wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Ch.3 Git and GitHub Quiz

Total questions: 30

Worksheet time: 10mins

Name
Class
Date
1.

What is the primary purpose of version control in software engineering?

a)

To manage project budgets

b)

To track changes in source code and applications

c)

To design user interfaces

d)

To compile code into executables

2.

Who developed Git and for what project?

a)

Bill Gates for Microsoft Windows

b)

Linus Torvalds for the Linux kernel project

c)

Steve Jobs for Apple macOS

d)

Mark Zuckerberg for Facebook

3.

In Git, what command is used to configure the user's name globally?

a)

git set user.name

b)

git config --global user.name

c)

git user --name

d)

git identity set name

4.

Which of the following is NOT a type of version control system mentioned in the document?

a)

Local Version Control Systems

b)

Centralized Version Control Systems

c)

Distributed Version Control Systems

d)

Cloud-based Version Control Systems

5.

What is the command to check the status of your Git repository?

a)

git commit

b)

git add

c)

git status

d)

git log

6.

What does 'commit' represent in Git workflow?

a)

Pushing changes to a remote repository

b)

Saving changes to the local repository with a message

c)

Creating a new branch

d)

Merging two branches

7.

Which Git command is used to create a new branch?

a)

git new-branch

b)

git branch {new branch name}

c)

git checkout -b {new branch name}

d)

git make branch

8.

What is the purpose of 'git push' command?

a)

To download changes from a remote repository

b)

To upload local repository changes to a remote repository

c)

To stage changes for commit

d)

To view commit history

9.

What is the command to download a repository from GitHub to your local machine?

a)

git download

b)

git get

c)

git clone

d)

git fetch

10.

What is the 'Staging Area' in Git also known as?

a)

Working Directory

b)

Remote Repository

c)

Index

d)

.git directory

11.

What is the main branch in Git often called, which stores the final version?

a)

Development branch

b)

Feature branch

c)

Master/Main branch

d)

Release branch

12.

Which command is used to initialize a new Git repository in the current directory?

a)

git start

b)

git new

c)

git init

d)

git create

13.

What does the command `git add .` do?

a)

Commits all changes to the repository

b)

Stages all new and modified files for the next commit

c)

Deletes all untracked files

d)

Pushes all changes to the remote repository

14.

Before pushing changes to a remote repository, what command is typically used after `git add`?

a)

git pull

b)

git clone

c)

git commit

d)

git status

15.

What is GitHub primarily used for?

a)

Local file storage

b)

Version control collaboration and backup

c)

Image editing

d)

Video streaming

16.

What is a 'fork' in GitHub terminology?

a)

A direct copy of a repository to your local machine

b)

A personal copy of another user's repository that lives on your GitHub account

c)

A way to merge changes from one branch to another

d)

A command to undo the last commit

17.

What is the purpose of a 'pull request' in GitHub?

a)

To directly merge changes into the main branch

b)

To request changes from a remote repository

c)

To propose changes and ask others to review and merge them

d)

To delete a branch from the repository

18.

Which command is used to download changes from a remote repository to your local branch?

a)

git push

b)

git add

c)

git commit

d)

git pull

19.

What is the difference between `git pull` and `git fetch`?

a)

`git pull` only downloads changes, `git fetch` downloads and merges

b)

`git fetch` only downloads changes, `git pull` downloads and merges

c)

`git pull` is for local repositories, `git fetch` is for remote

d)

There is no difference, they are interchangeable

20.

What is the working directory in Git?

a)

The hidden `.git` folder

b)

The area where you modify files

c)

The staging area

d)

The remote repository

21.

What command would you use to see the history of commits?

a)

git status

b)

git log

c)

git diff

d)

git show

22.

What is a 'Personal Access Token' used for in GitHub?

a)

To change your GitHub password

b)

To authenticate Git operations without exposing your password

c)

To share your repository with others

d)

To delete your GitHub account

23.

When working alone, after making changes to a cloned repository, what is the typical sequence of Git commands to update the remote repository?

a)

git commit, git add, git push

b)

git add, git commit, git push

c)

git push, git add, git commit

d)

git clone, git add, git commit

24.

What is the primary benefit of using a Distributed Version Control System (DVCS) like Git?

a)

It relies on a central server for all operations

b)

Each developer has a full copy of the repository history

c)

It is simpler to set up than other VCS types

d)

It only tracks changes made by a single user

25.

What does `git merge` do?

a)

Undoes the last commit

b)

Combines changes from different branches into one

c)

Deletes a branch

d)

Renames a branch

26.

What is the command to view the content of a file in the shell?

a)

ls

b)

cd

c)

cat

d)

mkdir

27.

What is the purpose of `git checkout`?

a)

To record changes to the repository

b)

To switch between branches or restore working tree files

c)

To send changes to the remote repository

d)

To download a repository

28.

In the context of GitHub collaboration, if Daniel designates Peter as a collaborator, what can Peter then do?

a)

Only view Daniel's repository

b)

Push directly to Daniel's repository

c)

Only fork Daniel's repository

d)

Request changes from Daniel

29.

If you run the following command:
" tar -czf backup.tar.gz --exclude='*.log' /var/www "

What will happen?

a)

Creates a gzipped tarball of /var/www, excluding all .log files.

b)

Creates a tarball of only .log files in /var/www.

c)

Deletes .log files before creating the tarball.

d)

Creates a tarball but ignores the compression step.

30.

What is the significance of the `.git` directory within a repository?

a)

It stores the actual project files

b)

It contains all the metadata and object database for the repository

c)

It is the staging area for changes

d)

It is where the remote repository is located