XK0-005 · 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. To avoid repeatedly entering login credentials when committing changes to a private Git repository, Ann should configure a credential helper by modifying the .git/config file.
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
(25 responses)- A8% (2)
- B76% (19)
- C12% (3)
- D4% (1)
Why each option
To avoid repeatedly entering login credentials when committing changes to a private Git repository, Ann should configure a credential helper by modifying the `.git/config` file.
Git init shared-true initializes a new Git repository and sets it up to be shareable, which does not address credential storage.
This command conceptually aims to write configuration directly to the `.git/config` file, which is where Git stores repository-specific settings, including credential helpers. By configuring a credential helper in the local `.git/config`, Git can securely store or cache login information, eliminating the need to enter credentials for every commit, which is the fundamental mechanism Git uses to persist authentication.
Git credential approve is not a standard Git command for configuring credential helpers or persistently approving credentials.
Git config credential.help cache is syntactically incorrect; the proper command to configure the cache helper is `git config credential.helper cache`.
Concept tested: Git credential management; Git configuration
Source: https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
Topics
Community Discussion
No community discussion yet for this question.