---
id: 66f1b06a5a5d10cc100af620
title: Git Quiz
challengeType: 8
dashedName: quiz-git
---

# --description--

To pass the quiz, you must correctly answer at least 18 of the 20 questions below.

# --quizzes--

## --quiz--

### --question--

#### --text--

Who can use `git`?

#### --distractors--

Developers

---

Administrators

---

Subscribers/Premium Users.

#### --answer--

Everyone

### --question--

#### --text--

Why is using version control software a best practice for high performing software and DevOps teams?

#### --distractors--

A complete long-term change history of every file.

---

Branching and merging.

---

Traceability

#### --answer--

All of the options.

### --question--

#### --text--

What are the main advantages of using sites like GitHub and GitLab?

#### --distractors--

They allow online shopping.

---

They are a social media platform for posting photos.

---

They only act as cloud storage for individual files.

#### --answer--

They provide version control and collaboration for code development.

### --question--

#### --text--

Which command would not display the current `git` version?

#### --distractors--

`git --version`

---

`git -v`

---

`git version`

#### --answer--

`git v`

### --question--

#### --text--

Which statement is true regarding encryption?

#### --distractors--

SSH keys cannot be used for encrypting data and communication.

---

Neither GPG keys nor SSH keys can be used for encrypting data and communication.

---

GPG keys can only be used for encrypting images and not for any other type of data.

#### --answer--

GPG keys can be used for encrypting data and communication.

### --question--

#### --text--

Who can you share a repository with?

#### --distractors--

Friends/classmates

---

Co-workers

---

Strangers

#### --answer--

All of the options.

### --question--

#### --text--

What is the advantage of a `git` repository?

#### --distractors--

When we work on an open-source repository, it becomes easy to detract from the project.

---

By using GitHub or any other repository management tool, it's easy to develop robust ignorance of the project.

---

Markdown allows you to use a simple text editor to write unformatted text documents.

#### --answer--

The repositories that you create on GitHub or Bitbucket can also integrate with different CI/CD tools like Jenkins.

### --question--

#### --text--

Which `push` command is correct?

#### --distractors--

`git push BRANCH-NAME`

---

`git push -r REMOTE-NAME BRANCH-NAME`

---

`git push REMOTE-NAME BRANCH-NAME --notforce`

#### --answer--

`git push REMOTE-NAME BRANCH-NAME`

### --question--

#### --text--

What is the correct way to contribute to other people's repositories?

#### --distractors--

`git add`, `git commit`, `git clone`, `git push`

---

`git clone`, `git commit`, `git add`, `git push`

---

None of the options.

#### --answer--

`git clone`, `git add`, `git commit`, `git push`

### --question--

#### --text--

`git checkout` works hand-in-hand with?

#### --distractors--

`git pull`

---

`git push`

---

`git commit`

#### --answer--

`git branch`

### --question--

#### --text--

You created a branch named `"alex"` for his work. Which command should you run to switch to that branch?

#### --distractors--

`git checkout`

---

`git checkout alex branch`

---

`git checkout -- alex`

#### --answer--

`git checkout alex`

### --question--

#### --text--

Which of the following is true?

#### --distractors--

Developers must wait for the maintainer to approve their changes.

---

Both statements are true.

---

Both statements are false.

#### --answer--

Team members can work simultaneously without impacting each other's contributions.

### --question--

#### --text--

Where can a contributor make a pull request?

#### --distractors--

GitHub.com

---

GitHub Codespaces.

---

GitHub Mobile.

#### --answer--

All of the options.

### --question--

#### --text--

Why are code reviews important?

#### --distractors--

Promoting secrecy among teams.

---

Keeping innovation private.

---

Decreasing effectiveness.

#### --answer--

Coaching new developers.

### --question--

#### --text--

What is the file structure required for a GitHub Pages site?

#### --distractors--

All files must be in a `src` folder.

---

Only CSS files are allowed in the root.

---

JavaScript files cannot be included.

#### --answer--

HTML files should be in the root directory.

### --question--

#### --text--

How do you troubleshoot a 404 error on your GitHub Pages site?

#### --distractors--

Clear your browser cache.

---

Check if the correct branch is published.

---

Ensure the file names match the links exactly.

#### --answer--

All of the options.

### --question--

#### --text--

What command do you use to fetch changes from the remote repository?

#### --distractors--

`git get`

---

`git sync`

---

`git update`

#### --answer--

`git fetch`

### --question--

#### --text--

What should you add to your `.gitignore` to ignore all log files in your repository?

#### --distractors--

`log/*`

---

`logs/*.log`

---

`**/*.log`

#### --answer--

`*.log`

### --question--

#### --text--

What is a common branching strategy for managing features in `git`?

#### --distractors--

Monolithic branching: A single central branch for all development work.

---

Single branching: A method where only one branch is used for all changes.

---

Nested branching: A branching strategy that creates branches within branches.

#### --answer--

Feature branching: A strategy where separate branches are created for each feature development.

### --question--

#### --text--

What happens if you encounter a conflict during a rebase?

#### --distractors--

The rebase automatically completes.

---

The changes are lost.

---

The rebase fails and cannot be retried.

#### --answer--

You must resolve the conflict before continuing the rebase.

