Examination (2026 Edition) | Verified
Questions and Answers with Detailed
Rationales | Comprehensive Certification
Preparation Guide
Question 1
A Linux administrator wants to create a new Git repository
while preserving the history of an existing project directory.
Which command sequence is most appropriate?
A. git clone . && git init
B. git init && git add . && git commit -m "Initial commit"
C. git checkout --history && git commit
D. git branch --create-history
Correct Answer: B. git init && git add . && git commit -m
"Initial commit"
Rationale: The git init command creates a new repository in
the existing directory. Files are then staged using git add and
permanently recorded with an initial commit. The other
options either use invalid Git commands or do not preserve
the existing project structure.
Question 2
,A developer accidentally committed sensitive credentials to a
Git repository. Which Git feature is most appropriate for
removing the file from all previous commits?
A. git merge --abort
B. git reset --soft HEAD~1
C. git filter-repo
D. git stash save
Correct Answer: C. git filter-repo
Rationale: git filter-repo is the modern recommended tool for
rewriting repository history and removing sensitive data from
previous commits. A normal reset only affects recent commits
and does not eliminate the information from historical
objects.
Question 3
Which Git object stores the complete snapshot of files at a
specific point in repository history?
A. Blob
B. Tag
C. Commit message
D. Tree object
Correct Answer: D. Tree object
Rationale: Git trees represent directory structures and
reference blobs and other trees to create a snapshot. Blobs
store file contents, while commits reference trees along with
metadata.
,Question 4
A system administrator runs git status and sees files listed
under "Changes not staged for commit." What does this
indicate?
A. Files are already committed
B. Files exist only in the remote repository
C. Files have modifications in the working directory that are
not staged
D. The repository is corrupted
Correct Answer: C. Files have modifications in the working
directory that are not staged
Rationale: Git separates the working directory, staging area,
and repository history. Modified files appear in this section
when changes exist locally but have not been added using git
add.
Question 5
Which Git command displays commit history with
abbreviated hashes and a graphical branch representation?
A. git log --files
B. git log --oneline --graph --decorate
C. git history --branches
D. git branch --show-log
Correct Answer: B. git log --oneline --graph --decorate
, Rationale: This combination provides a compact visual
representation of commits, branches, and tags. The other
commands are either invalid or do not display complete
commit relationships.
Question 6
A developer wants to temporarily save uncommitted changes
before switching branches. Which command should be used?
A. git commit --temporary
B. git branch save
C. git stash
D. git archive
Correct Answer: C. git stash
Rationale: Git stash stores uncommitted changes in a
temporary stack, allowing developers to switch contexts
without committing incomplete work.
Question 7
What is the primary purpose of a Git remote?
A. Store encrypted passwords
B. Replace local repositories
C. Reference another repository location for synchronization
D. Automatically resolve conflicts
Correct Answer: C. Reference another repository location
for synchronization