XK0-004 · Question #355
Ann, a Linux administrator, is storing scripts in a private Git repository. Which of the following commands should Ann use to avoid entering the login and password every time Ann commits change?
The correct answer is B. Echo authe n tapprove `'>> .git/config. Git credential caching stores authentication credentials so that users are not prompted for a username and password on every commit or push.
Question
Ann, a Linux administrator, is storing scripts in a private Git repository. Which of the following commands should Ann use to avoid entering the login and password every time Ann commits change?
Options
- AGit init shared-true
- BEcho authe n tapprove `'>> .git/config
- CGit credential approve
- DGit config credential.help cache
How the community answered
(31 responses)- A3% (1)
- B94% (29)
- D3% (1)
Why each option
Git credential caching stores authentication credentials so that users are not prompted for a username and password on every commit or push.
Git init --shared sets group-writeable permissions on a repository to allow multiple users access, and has no effect on credential storage or caching.
Configuring a Git credential helper by writing the appropriate setting to .git/config allows Git to cache or store user credentials, eliminating repeated prompts during operations such as commit and push. Storing credential helper configuration directly in the repository config file enables persistent authentication for that repository without requiring user input on each interaction.
Git credential approve manually passes a single credential into the credential helper but does not configure automatic credential caching for future operations.
The correct configuration key is credential.helper - not credential.help - making this command syntactically invalid and unable to configure any caching behavior.
Concept tested: Git credential helper configuration to cache login credentials
Source: https://git-scm.com/docs/gitcredentials
Topics
Community Discussion
No community discussion yet for this question.