nerdexam
CompTIA

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.

System Management

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)
  • A
    8% (2)
  • B
    76% (19)
  • C
    12% (3)
  • D
    4% (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.

AGit init shared-true

Git init shared-true initializes a new Git repository and sets it up to be shareable, which does not address credential storage.

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

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.

CGit credential approve

Git credential approve is not a standard Git command for configuring credential helpers or persistently approving credentials.

DGit config credential.help cache

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

#Git configuration#Credential management#Version control

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice