Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CloudBinary_Git_Commands_Quiz

Total questions: 15

Worksheet time: 15mins

Name
Class
Date
1.

What command is used to initialize a new Git repository?

a)

git start

b)

git init

c)

git create

d)

git new

2.

How do you add changes to the staging area in Git?

a)

git stage

b)

git add

c)

git commit -a

d)

git update

3.

What command is used to commit changes in Git with a message?

a)

git commit -m "Message"

b)

git save -m "Message"

c)

git push "Message"

d)

git commit-message "Message"

4.

What command is used to view the commit history in Git?

a)

git show

b)

git history

c)

git log

d)

git commits

5.

How do you clone a remote Git repository?

a)

git pull <repository_url>

b)

git copy <repository_url>

c)

git clone <repository_url>

d)

git fetch <repository_url>

6.

What command is used to push changes to a remote repository in Git?

a)

git send

b)

git upload

c)

git push

d)

git commit-push

7.

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

a)

git check

b)

git status

c)

git info

d)

git current

8.

What command is used to fetch changes from a remote repository in Git?

a)

git fetch

b)

git pull

c)

git sync

d)

git download

9.

What command is used to rename a branch in Git?

a)

git rename-branch

b)

git branch-rename

c)

git branch -m

d)

git mv-branch

10.

How do you switch to a different branch in Git?

a)

git switch-branch <branch_name>

b)

git branch-switch <branch_name>

c)

git move <branch_name>

d)

git checkout <branch_name>

11.

What does the command git clone [repository] do?

a)
  • A) Commits changes to a repository.

b)
  • B) Creates a new branch.

c)
  • C) Copies a repository from a remote server.

d)
  • D) Shows the status of changes.

12.

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

a)
  • A) git merge

b)
  • B) git branch [branch-name]

c)
  • C) git checkout

d)
  • D) git commit

13.

What is the purpose of git commit -m "message"?

a)
  • A) To change the current branch.

b)
  • B) To merge branches.

c)
  • C) To update the remote repository.

d)
  • D) To record changes to the repository with a message.

14.

How do you update your local repository to match the remote repository in Git?

a)
  • A) git commit

b)
  • B) git pull

c)
  • C) git push

d)
  • D) git branch

15.

Which command shows the history of commits?

a)
  • A) git log

b)
  • B) git status

c)
  • C) git commit

d)
  • D) git branch