Question 530
The operator must inspect which lines changed in unstaged tracked files since the index snapshot. Which command fits?
- git stash push
- git reset --mixed HEAD~1
- git restore --staged config.yml
- git diff
Explanation
Correct Answer
D:By default git diff presents tracked changes that have not yet been staged, without altering either file contents or index. --cached instead inspects staged differences against the commit.
Incorrect Answers
A:Stash saves eligible working-tree and index changes in a local stack for later application; the administrator instead needs viewing unstaged textual differences; this option serves a different purpose.
B:A mixed reset moves the current branch and resets the index while retaining tracked working-tree changes; it answers a neighboring question rather than viewing unstaged textual differences.
C:Restore with --staged resets the index entry to the current commit while preserving working-tree edits; that changes a different part of the system; the requested outcome is viewing unstaged textual differences.
Question 531
The engineer must download new remote refs without merging them into the current branch. Which command is appropriate?
- git push origin feature
- git pull
- git clone repository-url
- git log --oneline
- git fetch origin
Explanation
Correct Answer
E:git fetch updates remote-tracking references and objects without updating the checked-out branch's working files. It permits review before integration.
Incorrect Answers
A:git push updates a remote branch when authorization and remote history allow it; using it would leave retrieving remote changes without integrating them unresolved.
B:git pull obtains remote changes and integrates them according to configuration or explicit options; the requirement is retrieving remote changes without integrating them, outside the effect of this choice.
C:git clone creates a local repository from a remote source with fetched history and default branch; it does not deliver retrieving remote changes without integrating them, which is decisive in this scenario.
D:git log displays revisions, and --oneline formats abbreviated commit identifiers with subjects; the evidence calls for retrieving remote changes without integrating them, not merely this separate operation.
Question 532
A project's generated temporary files must not appear as untracked candidates in normal Git status. Which file defines exclusions?
- git add config.yml
- .gitignore
- git init
- git status
Explanation
Correct Answer
B:.gitignore patterns suppress matching untracked paths from normal addition. They do not stop tracking files already committed.
Incorrect Answers
A:git add updates the index for the specified paths; its scope differs from ignoring untracked generated files, so it cannot meet the stated requirement.
C:git init creates the .git metadata required for version control; the administrator instead needs ignoring untracked generated files; this option serves a different purpose.
D:git status reports working tree and staging-area differences against the current commit; it answers a neighboring question rather than ignoring untracked generated files.
Question 533
Uncommitted local edits must be set aside before temporarily switching tasks, then reapplied later. Which command is helpful?
- git reset --mixed HEAD~1
- git diff
- git stash push
- git restore --staged config.yml
- Squash merge
- git fetch origin
Explanation
Correct Answer
C:Stash saves eligible working-tree and index changes in a local stack for later application. Untracked files need explicit inclusion flags.
Incorrect Answers
A:A mixed reset moves the current branch and resets the index while retaining tracked working-tree changes; this does not achieve temporarily shelving local changes on the system described.
B:git diff is a read-only comparison of tracked edits against the staging area; it cannot selectively fetch remote references. --cached instead inspects staged differences against the commit; it will not provide temporarily shelving local changes under these conditions.
D:Restore with --staged resets the index entry to the current commit while preserving working-tree edits; the requirement is temporarily shelving local changes, outside the effect of this choice.
E:A squash merge combines changes into a single staged result for one new commit; it does not deliver temporarily shelving local changes, which is decisive in this scenario.
F:git fetch updates remote-tracking references and objects without updating the checked-out branch's working files; the evidence calls for temporarily shelving local changes, not merely this separate operation.
Question 534
A local commit must be published to the remote repository for collaborators. Which command performs this?
- git log --oneline
- git clone repository-url
- git push origin feature
- git pull
Explanation
Correct Answer
C:git push updates a remote branch when authorization and remote history allow it. It does not automatically create a pull request.
Incorrect Answers
A:git log displays revisions, and --oneline formats abbreviated commit identifiers with subjects; the evidence calls for publishing a local branch to a remote, not merely this separate operation.
B:git clone creates a local repository from a remote source with fetched history and default branch; the task involves publishing a local branch to a remote, whereas this addresses another subsystem.
D:git pull obtains remote changes and integrates them according to configuration or explicit options; that is not equivalent to publishing a local branch to a remote.
Question 535
The current branch should integrate remote changes as part of a pull workflow. Which Git command typically fetches then merges or rebases?
- git pull
- git log --oneline
- git clone repository-url
- git config --local user.email admin@example.org
Explanation
Correct Answer
A:git pull obtains remote changes and integrates them according to configuration or explicit options. A fetch-only operation is less intrusive.
Incorrect Answers
B:git log displays revisions, and --oneline formats abbreviated commit identifiers with subjects; that changes a different part of the system; the requested outcome is downloading and integrating upstream changes.
C:git clone creates a local repository from a remote source with fetched history and default branch; this does not achieve downloading and integrating upstream changes on the system described.
D:Local Git configuration is stored in the repository and overrides broader user settings; it will not provide downloading and integrating upstream changes under these conditions.
Question 536
A company prohibits sending source code to third-party LLMs. What must the engineering team do?
- Redact or withhold sensitive log data per approved policy
- Follow the organization's approved AI tool and data policy
- An approved locally hosted model
- Validate command effects in a safe test environment
Explanation
Correct Answer
B:Organizational policy governs permissible models and disclosure. Technical feasibility does not override confidentiality and contractual controls.
Incorrect Answers
A:Data governance determines whether personal information and secrets may be sent to external services; the requirement is respecting restrictions on proprietary source disclosure, outside the effect of this choice.
C:Local inference can limit external transmission when its deployment and access controls are properly designed; the evidence calls for respecting restrictions on proprietary source disclosure, not merely this separate operation.
D:Generated commands may be unsafe or wrong for the target filesystem; the task involves respecting restrictions on proprietary source disclosure, whereas this addresses another subsystem.
Question 537
A script generated by an LLM contains a hardcoded cloud API secret. Which response is appropriate?
- An approved locally hosted model
- Remove and rotate the exposed credential
- Validate command effects in a safe test environment
- Redact or withhold sensitive log data per approved policy
Explanation
Correct Answer
B:A credential that entered generated artifacts or prompts may already be compromised. Replacing literals with controlled secret retrieval reduces further risk.
Incorrect Answers
A:Local inference can limit external transmission when its deployment and access controls are properly designed; that is not equivalent to remediating a disclosed secret in generated code.
C:Generated commands may be unsafe or wrong for the target filesystem; it answers a neighboring question rather than remediating a disclosed secret in generated code.
D:Data governance determines whether personal information and secrets may be sent to external services; that changes a different part of the system; the requested outcome is remediating a disclosed secret in generated code.
Question 538
An engineer needs reliable AI output for a specific Bash version and output format. What prompt improvement helps?
- State runtime constraints and required output explicitly
- Inspect the IaC diff and resulting plan
- Benchmarks plus restore-test results
- Test the regex against positive and negative examples
- Corroborate the recommendation with current authoritative documentation
Explanation
Correct Answer
A:Giving the shell version, input examples and constraints can narrow ambiguity. The result still needs independent checking.
Incorrect Answers
B:Infrastructure changes must be checked for unintended destruction, privilege changes and drift; using it would leave reducing ambiguity in automation code requests unresolved.
C:Faster execution is not useful if backup integrity or restoration correctness suffers; the requirement is reducing ambiguity in automation code requests, outside the effect of this choice.
D:Pattern suggestions can overmatch or miss edge cases; it does not deliver reducing ambiguity in automation code requests, which is decisive in this scenario.
E:An LLM's answer is not a primary policy reference and may omit environmental prerequisites; the evidence calls for reducing ambiguity in automation code requests, not merely this separate operation.
Question 539
An AI assistant suggests changes to an OpenTofu plan. What should be reviewed before applying them?
- Corroborate the recommendation with current authoritative documentation
- Benchmarks plus restore-test results
- Test the regex against positive and negative examples
- Inspect the IaC diff and resulting plan
Explanation
Correct Answer
D:Infrastructure changes must be checked for unintended destruction, privilege changes and drift. A successful syntax parse is not sufficient evidence of safe impact.
Incorrect Answers
A:An LLM's answer is not a primary policy reference and may omit environmental prerequisites; the task involves reviewing generated infrastructure diffs and effects, whereas this addresses another subsystem.
B:Faster execution is not useful if backup integrity or restoration correctness suffers; its scope differs from reviewing generated infrastructure diffs and effects, so it cannot meet the stated requirement.
C:Pattern suggestions can overmatch or miss edge cases; that is not equivalent to reviewing generated infrastructure diffs and effects.
Question 540
A compliance reviewer requests evidence for an AI-generated security recommendation. What is the appropriate professional response?
- Corroborate the recommendation with current authoritative documentation
- Inspect the IaC diff and resulting plan
- Test the regex against positive and negative examples
- Benchmarks plus restore-test results
Explanation
Correct Answer
A:An LLM's answer is not a primary policy reference and may omit environmental prerequisites. Cited standards and direct system evidence are needed.
Incorrect Answers
B:Infrastructure changes must be checked for unintended destruction, privilege changes and drift; this does not achieve validating AI compliance claims against trusted sources on the system described.
C:Pattern suggestions can overmatch or miss edge cases; it will not provide validating AI compliance claims against trusted sources under these conditions.
D:Faster execution is not useful if backup integrity or restoration correctness suffers; using it would leave validating AI compliance claims against trusted sources unresolved.