GIT MCQ Questions And Answers - DevOps
GIT MCQs : This section focuses on "basics" of GIT. These Multiple Choice Questions (MCQ) should be practiced to improve the GIT skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. What is true about GIT?
A. Git is open-source
B. Git is an example of distributed version control system
C. Used for handling the development of small and large projects
D. All of the above
View Answer
Ans : D
Explanation: Git is the most popular, open-source, widely used, and an example of distributed version control system (DVCS) used for handling the development of small and large projects in a more efficient and neat manner.
2. A _________ keeps track of the contributions of the developers working as a team on the projects.
A. CVS
B. DVF
C. VCS
D. LFS
View Answer
Ans : C
Explanation: A VCS keeps track of the contributions of the developers working as a team on the projects. They maintain the history of code changes done and with project evolution, it gives an upper hand to the developers to introduce new code, fixes bugs, and run tests with confidence that their previously working copy could be restored at any moment in case things go wrong.
3. A repository is a file structure where git stores all the project-based files.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, A repository is a file structure where git stores all the project-based files. Git can either stores the files on the local or the remote repository.
4. Which command creates a copy of an existing git repository.
A. git copy
B. git clone
C. git replace
D. git move
View Answer
Ans : B
Explanation: git clone : The command creates a copy (or clone) of an existing git repository. Generally, it is used to get a copy of the remote repository to the local repository.
5. The _________ command is a convenient way to set configuration options for defining the behavior of the repository, user information and preferences, git installation-based configurations, and many such things
A. git head
B. git conflict
C. git status
D. git config
View Answer
Ans : D
Explanation: The git config command is a convenient way to set configuration options for defining the behavior of the repository, user information and preferences, git installation-based configurations, and many such things.
6. git fetch + git merge equal to?
A. git push
B. git branch
C. git pull
D. None of the above
View Answer
Ans : C
Explanation: This command pulls new changes from the currently working branch located in the remote central repository.
7. Which of the following is true about Centralized version control system?
A. It does not rely on the central server
B. It is victim to single point of failure
C. It rely on the central server
D. Both B and C
View Answer
Ans : D
Explanation: Both B and C is true about Centralized version control system.
8. The files that can be committed are always present in gitĀ
A. working directory
B. staging area
C. unstaged area
D. Anywhere, there is no barrier
View Answer
Ans : B
Explanation: The files that can be committed are always present in gitĀ staging area
9. Git can be used for which project?
A. Java enterprise project
B. .Net project
C. File version management
D. All of the above
View Answer
Ans : D
Explanation: Git can be used for all of the above project
10. A head is nothing but a reference to the last commit object of a branch.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, A head is nothing but a reference to the last commit object of a branch.
Discussion