git-credential-store - Linux


Overview

git-credential-store manages Git credentials like usernames, passwords, and access tokens, protecting them from unauthorized access. It stores these credentials in an encrypted secure store and provides access through a standard interface for Git clients.

Syntax

git credential-store [--version] [--help] [--quiet] [--debug] [--show]
                   [--remove] [--force] [--file <path>]
                   <protocol> [<host> [<path>]]

Options/Flags

  • --version: Displays the version of git-credential-store.
  • --help: Prints the help message and exits.
  • --quiet: Suppresses any non-error output.
  • --debug: Enables debug logging.
  • --show: Lists all stored credentials.
  • --remove: Removes the specified credential.
  • --force: Forces the removal of a credential, even if it is the default credential for a protocol/host.
  • --file <path>: Specifies the path to the credential store file. Defaults to ~/.git-credentials.
  • <protocol>: The protocol for which credentials are being managed, e.g., https.
  • <host>: The hostname of the server for which credentials are being managed.
  • <path>: The path to the resource on the server for which credentials are being managed.

Examples

List all stored credentials:

git credential-store --show

Add credentials for a host:

git credential-store https://github.com

Remove credentials for a host:

git credential-store --remove https://github.com

Common Issues

Permission denied:

  • Ensure that the file permissions of ~/.git-credentials allow read/write access for the current user.

Missing input:

  • If no protocol, host, or path is provided, the command will prompt for input.

Integration

git-credential-store seamlessly integrates with Git clients. Once enabled, it will automatically manage Git credentials, eliminating the need to store them plaintext in the Git configuration file.

Related Commands

  • git-config: Configures Git settings, including credential manager.
  • git-credential-fill: Fills Git credentials from the store.
  • git-credential-approve: Approves a credential request.