wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Git, GitHub, and ReactJS Fundamentals

Total questions: 30

Worksheet time: 14mins

Name
Class
Date
1.

Which command initializes a new Git repository?

a)

git start

b)

git init

c)

git new

d)

git create

2.

Which Git command is used to move changes from the working directory into the staging area, preparing them for commit?

a)

git stage

b)

git add

c)

git commit

d)

git push

3.

What does git clone do?

a)

Creates a new branch

b)

Copies a remote repository to your local machine

c)

Uploads files to GitHub

d)

Deletes a repository

4.

Which Git command shows the list of previous commits in a repository, including author, date, and message?

a)

git history

b)

git log

c)

git commits

d)

git view

5.

What is the main purpose of GitHub?

a)

Host and share code repositories online

b)

Replace Git commands

c)

Debug JavaScript code

d)

Run CSS styling

6.

What is a Pull Request in GitHub?

a)

A request to create a new repository

b)

A request to merge code changes into another branch

c)

A request to delete a repository

d)

A request to pull updates from Git

7.

Which command downloads changes from a remote repository but does not merge them?

a)

git merge

b)

git fetch

c)

git pull

d)

git update

8.

What does git push do?

a)

Uploads local commits to a remote repository

b)

Downloads commits from GitHub

c)

Deletes a branch

d)

Saves changes to the staging area

9.

Good Git management includes:

a)

Committing often with meaningful messages

b)

Deleting all branches after use

c)

Avoiding code reviews

d)

Only pushing at the end of the project

10.

In React, which function is used to create a state variable?

a)

useState()

b)

useEffect()

c)

useContext()

d)

setState()

11.

Which React hook runs side effects like API calls?

a)

useEffect()

b)

useState()

c)

useReducer()

d)

useMemo()

12.

In React, how do you import a component named Header?

a)

import Header from './Header';

b)

include Header from './Header';

c)

require Header './Header';

d)

fetch Header './Header';

13.

How do you inject JavaScript expressions inside JSX (React HTML)?

a)

{{ expression }}

b)

%% expression %%

c)

{ expression }

d)

<< expression >>

14.

Which statement about dynamic components is true?

a)

They are hard-coded and cannot change.

b)

They adapt based on props or state.

c)

They cannot be reused.

d)

They must always use CSS modules.

15.

What is the default styling method in React?

a)

Inline CSS

b)

External CSS file imports

c)

Using styled-components

d)

Any of the above methods can be used

16.

What does useEffect() with an empty dependency array [] do?

a)

Runs only once after the initial render

b)

Runs on every render

c)

Runs only when state changes

d)

Never runs

17.

In React, what does .map() typically help with?

a)

Iterating arrays to display lists of elements

b)

Adding CSS styles

c)

Managing global state

d)

Handling API requests

18.

Which is NOT a best practice in Git commit messages?

a)

Writing clear and concise descriptions

b)

Using present tense

c)

Pushing all commits without reviewing

d)

Grouping related changes in one commit

19.

In React, props are:

a)

Variables used only for CSS styling

b)

Read-only data passed from parent to child components

c)

Functions that update state

d)

Hooks that manage lifecycle

20.

Which CSS rule is correct in a React component with inline style?

a)

style={{background-color: 'blue'}}

b)

style={{backgroundColor: 'blue'}}

c)

style="background-color: blue"

d)

style=(backgroundColor: blue)

21.

List three Git commands used for managing branches.

4 lines
22.

Enumerate the three main steps in the basic Git workflow (before pushing to remote).

4 lines
23.

Name at least three benefits of using GitHub in team projects.

4 lines
24.

Enumerate the stages of a Pull Request process.

4 lines
25.

List three good practices for Git commit messages.

4 lines
26.

Enumerate at least two React hooks.

4 lines
27.

List two ways to style components in React.

4 lines
28.

Enumerate the steps to import and render a component in React.

4 lines
29.

List three use cases for useEffect().

4 lines
30.

Enumerate at least three advantages of using dynamic components in React.

4 lines