wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Git & GitHub Quiz

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

Which is Distributed version control system?

a)

CSV

b)

perforce

c)

svn

d)

Git

2.

After you add a file, it becomes

a)

Committed

b)

Modified

c)

Staged

d)

Untracked

3.

Which of the following is true you when you use the following command?

a)

All new and updated files are staged

b)

Files are staged in alphabetical order.

c)

All new files are staged

d)

Only updated files are staged

4.

How do you supply a commit message to a commit?

a)
b)
c)
d)
5.

Which two configuration properties does the tool expect to be configured after installing Git and prior to issuing the first commit?

a)

email address and password

b)

username and password

c)

username and IP address

d)

username and email address

6.

What's a shortcut to staging all the changes you have?

a)

git commit add .

b)

git commit .

c)

git add .

d)

git stage -a

7.

Which of the following commands is used in switching between branches?

a)

git branch

b)

git checkout

c)

git switch

d)

git merge

8.

What is the area where uncommitted changes are temporarily held after adding?

a)

Staging Area

b)

Unstaging Area

9.

Command to check the created, modified, deleted files in gitbash before Commit?

a)

git show

b)

git log

c)

git status

d)

all of the above

10.

Which command should you use to initialize a new git repository?

a)

git install

b)

git bash

c)

git init

d)

git start

11.

You can type git status at any point while in a git controlled directory to check the status of your files?

a)

True

b)

False

12.

What command removes untracked files from your working directory.

a)

git commit

b)

git clean

c)

git clean -f <path>

d)

git reset

13.

Which programming language was used to create Git?

a)

C

b)

HTML

c)

PHP

d)

C++

14.

Which of the following commands will create a new branch?

a)

git checkout new-branch

b)

git checkout -b new-branch

c)

git clone new-branch

d)

git create-branch new-branch

15.

Which of the following is one of Git's powerful features?

a)

Rooting

b)

Leafing

c)

Branching

d)

Planting

16.

Command to add particular file changes to staging area from working directory?

a)

git pull

b)

git add .

c)

git add file_name

d)

git commit -m

17.

To make a new git branch, the git command is?

a)

git branch branch_name

b)

git -b

c)

git new branch_name

d)

git checkout branch_name

18.

Who is attributed with inventing Git?

a)

Junio C. Hamano

b)

James Gosling

c)

Kohsuke Kawaguchi

d)

Linus Torvalds

19.

What do you call a system the records the project code's changes over time?

a)

Repository System

b)

Code Change System

c)

Version Control System

d)

none of the above

20.

Which file can you configure to ensure that certain files are never committed to the local Git repository?

a)

Ignore.git

b)

.gitignore

c)

gitignore.txt

d)

git.ignore

21.

What is the full form of GIT?

a)

Gastro Intestional Track.

b)

Global information Tracker

c)

Gastro International Track.

d)

None of these

22.

We have just created a new file called “sum.java”. Which of the following will add this file so that we can commit it in git?

a)

$ git add sum.java

b)

$ git add new

c)

$ git add -a sum.java

d)

$ git git commit sum.java

23.

Which of the following git command that downloads your repository from GitHub to your computer?

a)

git fork

b)

git commit

c)

git clone

d)

git push

24.

How do you create a copy of a lab under your own GitHub account so that you can solve the lab?

a)

Forking it via the GitHub interface.

b)

git clone

c)

git pull-request

d)

git fork

25.

What is the function of ‘GIT PUSH’ in GIT?

a)

‘GIT PUSH’ updates remote refs.

b)

‘GIT PUSH’ remote refs along with associated objects.

c)

'GIT PUSH’ updates remote refs along with associated objects.

d)

None of these

26.

Which of these git client commands creates a copy of the repository?

a)

clone

b)

update

c)

import

d)

checkout

27.

Which of the following commands used to show all parameters in git?

a)

$ git config -a

b)

$ git config --list

c)

$ git config --all

d)

$ git config --parameters --list

28.

Which of the following commands used to undo a commit?

a)

$ git reset <commit>

b)

$ git revert <commit>

c)

$ git reset --hard origin/master

d)

$ git init

29.

Which of the following commands used to permanently cancel a commit?

a)

$ git reset <commit>

b)

$ git revert <commit>

c)

$ git reset --hard origin/master

d)

$ git init

30.

How to create a new branch and switch to it directly?

a)

$ git checkout <branch-name>

b)

$ git branch <branch-name>

c)

$ git checkout -b <branch-name>

d)

$ git branch -new <branch-name>

31.

Which comes first _____?

a)

$ git add

b)

$ git commit

32.

Which of the following commands used to return to the master branch?

a)

$ git checkout origin

b)

$ git checkout -b master

c)

$ git checkout master

d)

$ git checkout branche

33.

.......... is equivalent to fetch and merge

a)

pull

b)

syncronize

c)

push

d)

fetch

34.

What will the following command print to the Terminal? $git remote -v

a)

A list of remote repositories you are connected to

b)

The current git version you're running

c)

An inline editor for modifying remote repositories

d)

The last 5 git versions you've installed

35.

Which command is useful for getting a high-level overview of the project history?

a)

$git log --oneline

b)

$git reset --hard

c)

$git log --author="<pattern>"

d)

$git rebase <base>

36.

Which of the following commands will merge branch-a into the master branch?

a)

git merge master and git checkout branch-a

b)

git checkout branch-a and git merge master

c)

git checkout master and git merge branch-a

d)

git merge branch-a and git checkout master

37.

Git commit command use to

a)

push changes from local repo to central repo

b)

stage changes

c)

push changes from staging area to local rep

d)

all of them

38.

Which one of them is incorrect command

a)

git add Test.txt

b)

git pull origin master

c)

git push origin master

d)

None

39.

How to do you delete a branch LOCALLY?

a)

git branch -d <branch>

b)

git delete <branch>

c)

git branch -delete <branch>

d)

None

40.

How do you Delete a branch REMOTELY?

a)

git push <remote> --d <branch>

b)

git push <remote> --delete <branch>

c)

git branch -d <branch>

d)

None