nerdexam
CompTIA

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.

Scripting, Containers and Automation

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)
  • A
    3% (1)
  • B
    94% (29)
  • D
    3% (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.

AGit init shared-true

Git init --shared sets group-writeable permissions on a repository to allow multiple users access, and has no effect on credential storage or caching.

BEcho authe n tapprove `'>> .git/configCorrect

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.

CGit credential approve

Git credential approve manually passes a single credential into the credential helper but does not configure automatic credential caching for future operations.

DGit config credential.help cache

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

#Git credentials#credential cache#authentication#git config

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice