Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Git Commands Quiz

Total questions: 15

Worksheet time: 11mins

Name
Class
Date
1.

What is Git primarily used for?

a)

Web Development

b)

Version Control

c)

Database Management

d)

Graphic Design

2.

Which command is used to initialize a new Git repository?

a)

git start

b)

git init

c)

git create

d)

git new

3.

What does the 'git clone' command do?

a)

Create a new branch

b)

Clone a repository from a remote server

c)

Create a copy of the local repository

d)

Move the repository to a new location

4.

What is the purpose of the 'git pull' command?

a)

Push changes to a remote repository

b)

Fetch changes from a remote repository and merge them

c)

Create a new branch

d)

Revert to a previous commit

5.

Which command is used to create a new branch in Git?

a)

git branch

b)

git new

c)

git create-branch

d)

git make-branch

6.

What does the 'git add' command do?

a)

Commit changes to the repository

b)

Add files to the staging area

c)

Create a new branch

d)

Delete files from the repository

7.

How do you discard changes in your working directory and revert to the last committed version of a file?

a)

git restore

b)

git discard

c)

git reset

d)

git revert

8.

What is a 'merge conflict' in Git?

a)

A conflict between team members

b)

A conflict between different branches trying to merge

c)

A conflict in the staging area

d)

A conflict in the commit history

9.

What is the purpose of the '.gitignore' file?

a)

It contains the Git repository's password

b)

It specifies files and directories that should be ignored by Git

c)

It defines the repository's structure

d)

It is used for storing commit messages

10.

Which Git command is used to view the commit history?

a)

git status

b)

git log

c)

git history

d)

git show

11.

What does the 'git push' command do?

a)

Pull changes from a remote repository

b)

Push changes to a remote repository

c)

Merge branches

d)

Undo the last commit

12.

What does the term 'fork' mean in the context of GitHub?

a)

Create a copy of a repository under your GitHub account

b)

Merge two branches

c)

Rollback to a previous commit

d)

Collaborate with others on a single branch

13.

What is a 'pull request' in GitHub?

a)

A request to merge changes from one branch to another

b)

A request to delete a repository

c)

A request for code review

d)

A request for a repository backup

14.

Which command is used to create a new repository on GitHub from the command line?

a)

git init

b)

git create

c)

git new

d)

git remote

15.

How do you create a README file for a GitHub repository?

a)

Using the 'git readme' command

b)

Manually create a file named README

c)

Automatically created by GitHub

d)

Using the 'git create-readme' command