Last Updated On
Welcome to the Git Quiz!
Git Multiple Choice Questions – MCQ2
Answers
1) c) Global information Tracker
2) d) All of the above
3) c) clone
4) a) Rejected
5) c) fetch and merge
6) b) clone
7) d) pull
8) d) git push
To learn more about this command, please refer to How to push new local GIT Repository to GitLab
9) a) git add .
To learn more about this command, please refer to How to stage changes in Git – git add Command
10) b) git checkout
11) c) The currently checked-out commit
In Git, HEAD is a special pointer or reference that points to the currently checked-out commit in the repository.
12) b) git reset HEAD~1
The git reset HEAD~1 command moves the current branch pointer back to the previous commit, effectively undoing the most recent commit. Note that there are different modes (like –soft, –hard) which decide the fate of changes during this operation.
13) d) git stash
To learn more about this command, please refer to How to stash changes in GIT – git stash command
14) b) git tag
15) d) squid
Git supports various merge strategies like fast-forward, recursive, and octopus. “squid” is not a merge strategy in Git.
16) d) git branch
17) b) Applies changes from a specific commit to the current branch
18) a) git clean
The git clean command removes untracked files from your working directory, ensuring your workspace is tidy.
19) c) A repository without a working directory
A bare repository in Git is a repository that contains only the .git directory and no working directory. It’s typically used for shared repositories and remotes.
20) b) git diff
21) a) git merge
The git merge command integrates changes from one branch into another. This is commonly used when features or bug fixes from one branch need to be brought into the main branch.
22) c) Overlapping changes between branches
A merge conflict occurs when there are changes in the same part of a file in both the current branch and the branch to be merged. Git cannot decide which change should take precedence, so it asks the user to resolve the conflict.
23) d) git clone
24) c) git remote add
25) c) git fetch