Git And GitHub

Git And GitHub

University

20 Qs

quiz-placeholder

Similar activities

QuizQuest

QuizQuest

University

15 Qs

Quiz Competition

Quiz Competition

University

20 Qs

Fundamentos de Desarrollo Web

Fundamentos de Desarrollo Web

University

22 Qs

GIT Básico

GIT Básico

University

18 Qs

UC10 - Versionamento de software

UC10 - Versionamento de software

University - Professional Development

15 Qs

Git and Github

Git and Github

University

15 Qs

Evaluación Final

Evaluación Final

University

20 Qs

GitThat30Bro

GitThat30Bro

University

15 Qs

Git And GitHub

Git And GitHub

Assessment

Quiz

Computers

University

Medium

Created by

Shashwat Mahendra

Used 5+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which command does you use to clone the remote repository to his local machine?
git init
git clone <repository-url>
git push origin main
git commit -m "Clone repository"

Answer explanation

The command git clone <repository-url> is used to clone a remote repository to the local machine.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which command should you use to add a new file called index.html to the staging area?
git add index.html
git commit -m "Add index file"
git push origin main
git checkout index.html

Answer explanation

The command git add index.html stages the index.html file for the next commit.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Once the file is staged, which command does you run to save his changes with a message?
git commit -m "Added index.html"
git clone <repository-url>
git add index.html
git branch new-feature

Answer explanation

The command git commit -m "Added index.html" commits the changes with the provided message.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To create a new branch for the contact page, which command does you use?
git commit -m "Contact page"
git branch contact-page
git push origin contact-page
git merge contact-page

Answer explanation

The command git branch contact-page creates a new branch named "contact-page".

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

After finishing work on the contact-page branch, which command does you use to merge the branch back into the main branch?
git push origin main
git checkout contact-page
git commit -m "Merge contact-page"
git merge contact-page

Answer explanation

The command git merge contact-page merges the "contact-page" branch into the current branch.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Once the merge is complete, which command should you use to update the remote repository?
git pull origin main
git push origin main
git branch -d contact-page
git status

Answer explanation

The command git push origin main updates the remote repository with the merged changes.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

you wants to see a detailed history of commits on the main branch with each commit’s hash and message. Which command should he use?
git log --oneline
git status
git diff
git reflog

Answer explanation

The command git log --oneline shows the commit history in a concise format, including commit hashes and messages.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?