LinuxCommandLibrary

git-credential-cache--daemon

Cache Git credentials for later use

SYNOPSIS

git-credential-cache--daemon [--timeout=<seconds>] <socket-path>

PARAMETERS

--timeout=<seconds>
    Specifies the number of seconds the daemon should remain idle before exiting. If not provided, it typically defaults to a value configured by credential.helperTimeout (e.g., 900 seconds or 15 minutes).

<socket-path>
    The mandatory path to the Unix domain socket that the daemon will create and listen on for incoming credential requests from other Git processes. This path is usually unique to the user's session and managed by the parent git-credential-cache process.

DESCRIPTION

The git-credential-cache--daemon command is an internal helper process launched by git-credential-cache. Its primary function is to provide a persistent, in-memory cache for Git credentials, typically HTTP or HTTPS passwords, across multiple Git operations within a user session. By running in the background, it avoids the need for users to repeatedly enter their credentials when performing operations like push or pull against remote repositories that require authentication. The daemon communicates with other Git processes via a Unix domain socket. It is designed to automatically terminate after a period of inactivity, configurable via the credential.helperTimeout Git configuration option. Users generally do not interact with this command directly; it is managed automatically by the higher-level git-credential-cache helper.

CAVEATS


Security: The daemon holds credentials in memory. While communication is via a Unix domain socket with appropriate permissions, users should be aware that credentials are in a persistent process for the configured timeout.
Direct Invocation: This command is not intended for direct user invocation. It is an internal component of Git's credential helper system and is managed automatically by git-credential-cache. Attempting to run it manually without proper setup may lead to unexpected behavior.

<I>PURPOSE AND LIFETIME</I>

The daemon runs as a background process, typically launched by the git credential-cache helper when no daemon is already running and a credential is requested. It will exit automatically after its configured timeout period (defaulting to 15 minutes, or as set by credential.helperTimeout in Git configuration) if no new credential requests are received. This ensures that sensitive credentials are not held in memory indefinitely.

<I>COMMUNICATION MECHANISM</I>

Communication between Git processes (which use the git credential-cache helper) and the daemon occurs via a Unix domain socket specified by the <socket-path> argument. This method provides a secure and efficient inter-process communication (IPC) channel on local systems, restricting access to processes with appropriate permissions.

HISTORY

The Git credential helper system was introduced to provide a flexible way to handle various authentication methods beyond SSH keys, particularly for HTTP/HTTPS protocols. The caching daemon, git-credential-cache--daemon, was developed as part of this system to enhance user experience by reducing the frequency of password prompts within a short timeframe. It became a standard component for managing temporary credential storage, preventing repetitive credential entry and improving workflow efficiency for users interacting with remote Git repositories.

SEE ALSO

Copied to clipboard