Olete.in
Articles
Mock Tests
🧪 GitLab MCQ Quiz Hub
Git MCQ
Choose a topic to test your knowledge and improve your GitLab skills
1. What is full form of VCS?
Version Configuration System
Version Consolidated Solutions
Version Configuration Solutions
Version Control System
2. Git is a __________
Distributed version control system
Centralized version control system
Localized version control system
All of the above
3. Which of the following is true about Git? 1. Git does not rely on the central server. 2. Git require network connection only to publish your changes and take the latest changes. 3. Every git checkout is a full backup of the server repository.
Only 1 & 2
Only 1 & 3
Only 2 & 3
All of the above
4. Which of the following terminology is not related to git?
staging area
fork
branch
stem
5. Which of the following is not true about git?
By default Git has a master branch
Git clone operation creates the instance of the repository.
Pull operation copies the changes from a local repository to remote repository
All of the above
6. Which of the following is example of distributed version control?
Git
Mercurial
SVN
Both A & B
7. Who created Git?
Dennis Ritchie
Linus Torvalds
Linus Babbage
James Gosling
8. Which of the following are the stages in which your git file can reside?
modified
staged
committed
Any of the above
9. Git command that lets you get and set configuration variables that control all aspects of how Git looks and operates is
git config
git --version
git init
All of the above
10. Which of the following is correct git command to set your username during git initial setup?
git config --global user.name "Rajneesh"
git config --global user "Rajneesh"
git init config --global user.name "Rajneesh"
git --global user.name "Rajneesh"
11. Git command to list all the settings Git can find at any point of time is
git config B.git config --settings C.D.
git config --settings
git --list
git config --list
12. To get the comprehensive manual page (manpage) help for any of the Git commands we can use
git help
git --help
man git- Dof the above
.Any of the above
13. Git command that helps us initialize git repository for the project (folder) that we intend to track using version control system Git is
git config
git init
git add .
None of These
14. Which of the following is true related to git init command? 1. A .git folder (sub-directory) is created within your git project (directory) once you run the git init command 2. .git is generally hidden folder.
only 1
only 2
Both 1 & 2
None of the 1 & 2
15. Which of the following is git tool?
Git Bash
GitK
Git GUI
All of the above
16. _____ is a version of the repository that diverges from the main working project.
master
branch
fork
clone
17. Which of the following command is used to switch between branches in a repository?
checkout
clone
fetch
pull
18. Which of the following command in git helps create copy of target repository?
pull
fetch
clone
tag
19. Which of the following are type of reset facility available in git?
soft
hard
mixed
All of the above
20. Which command can help you to switch branch without committing the current branch?
fetch
stash
fork
branch
21. The act of transferring commits from your local repository to a remote repository is known as ___________
push
pull
clone
rebase
22. The reference to the remote repository from where a project was initially cloned is called __________
origin
tag
head
index
23. What represents the last commit in the current checkout branch in git?
head
index
master
origin
24. Tags in git can be
light-weighted tag
heavy-weighted tag
annotated tag
All of the above
25. Which is the correct git command to add files to the repository?
git add
git add fileName
both of the above
None of the above
26. Which of the following is the correct git command to commit changes with proper message?
git commit
git commit "message"
git commit -m "message"
git commit -a "message"
27. Which of the following git command helps to add multiple changes at the same time?
git add -all
git add
git add . "fileName"
git add ...
28. What does the below git command indicates? git add *.java
The above command will stage all the Java source files
The above command will commit all the Java files
The above command will exclude all the Java files while staging
It will give error - "invalid command"
29. Which git command can help to stash a change with a message?
git stash save "message"
git stash -m "message"
git stash save -m "message"
git stash "message"
30. Which of the following git command can be used to check the stored stashes?
git stash list
git stash
git stash set
git stash map
31. Which of the following option is not valid with git stash command?
git stash list
git stash changes
git stash list pop
git stash list push
32. Which of the following statement is true about git ignore file?
The .gitignore file contains all the formats and files that should be ignored while commit
We can create multiple ignore files in a different directory.
Both of the above
None of the above
33. Which of the following will help you create a git repository?
create your local project and execute init command on that project path
clone remote repository
both of the above
None of these
34. Which command helps us to see the tracked, untracked files and changes but does not show any commit records?
git status
git diff
git log
Both A & C
35. Git log command contains following data
commit hash
commit date metadata
commit author metadata
All of the above
36. git log --oneline command will display
one commit per line
the first seven characters of the SHA
the commit message
All of the above
37. git command which displays the files that have been modified is
git log --patch
git log -p
None of the above
Both of the above
Submit