Git MCQ

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

By OnlineInterviewQuestions.

com
GIT MCQ Quiz

Take GIT Quiz To test your Knowledge


Below are few GIT MCQ tests that check your basic knowledge of GIT. This GIT Test contains around 20
questions of multiple choice with 4 options. You have to select the right answer to a question. You can see the
correct answer by clicking view answer link.

Also, Read Best GIT interview questions.

Q1. Which Command is used to show limited number of commits?

A. git fetch
B. git log -n
C. git config
D. git status

Q2. Which command defines the author email to be used for all commits by the current
user.

A. git clean -f
B. git config --global user.email
C. git merge --no-ff
D. git email--amend

Q3. ____________ 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=""
D. git rebase

Q4. ___________________ removes untracked files from your working directory.


A. git commit
B. git clean -f
C. git clean
D. git reset

Q5. Which command creates an empty Git repository in the specified directory?

A. git reset
B. git log ..
C. git init
D. git init --bare

Q6. Command to download all the objects and references from a specified repository

A. git config --list


B. git help
C. git fetch
D. git log -n

Q7. Git command to compare two specified branches

A. git diff ...


B. git merge
C. git blame -L ,
D. git push --tags

Q8. _____________ command renames the current branch to <branch>

A. git remote rm
B. git branch -m
C. git branch -D (CAPS)
D. git rebase

Q9. Which Git command displays the patch representing each commit.

A. git branch
B. git remote -v
C. git log -p
D. git log

Q10. Which of the following command line environment is used for interacting with Git ?

A. Git Bash
B. GitHub
C. Git Boot
D. Git Lab

Q11. In Git, if you want to make your local repository reflect changes that have been
made in a remote (tracked) repository, you should run the pull command

A. True
B. False

Q12. If you want to make radical changes to your team’s project and don’t want to impact
the rest of the team, you should implement your changes in -

A. the root
B. a tag
C. the trunk
D. None of the above

Q13. The Git clone command does which of the following?

A. Makes a local copy of the repository


B. Creates a working directory
C. Commits a new branch
D. Both 1 & 2

Q14. Which one of the following is not part of the data structure of a Git repository?

A. Branch pointer
B. Body element
C. Commit object
D. Head pointer
Q15. Which of these Git client commands creates a copy of the repository and a working
directory in the client’s workspace.

A. checkout
B. clone
C. import
D. update

Q16. Git is a .................... Version Control tool.

A. Decentralized
B. Centralized

Q17. GIT belongs to the............. generation of Version Control tools

A. 2nd
B. 3rd
C. 4th
D. 5th

Q18. The main objectives of Git are -

A. speed
B. data integrity
C. support for distributed non-linear workflows
D. All of the above

Q19. What language is used in Git?

A. C
B. HTML
C. PHP
D. C++

Q20. Git command .................... used to give tags to the specified commit.

A. git checkout [branch name]


B. git show [commit]
C. git tag [commitID]
D. git rm [file]

Please Visit OnlineInterviewquestions.com to download more pdfs

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy