LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-credential-store

Store credentials in plain-text file

TLDR

Store credentials in file
$ git config credential.helper store
copy
Store in specific file
$ git config credential.helper 'store --file ~/.git-credentials'
copy

SYNOPSIS

git credential-store [options]

DESCRIPTION

git credential-store is a credential helper that permanently stores authentication credentials in a plain-text file on disk. By default, credentials are stored in ~/.git-credentials, but a custom path can be specified with the --file option.When configured, it saves credentials after the first successful authentication and automatically provides them for subsequent operations. The file format is simple: each line contains a URL with embedded credentials in the form https://username:password@hostname/path.While convenient for eliminating password prompts permanently, this approach has significant security implications. Credentials are stored unencrypted and readable by anyone with filesystem access. For better security, consider platform-specific alternatives like macOS Keychain, Windows Credential Manager, or git-credential-cache for temporary memory-only storage.

PARAMETERS

--file path

Credential file path.

CONFIGURATION

~/.git-credentials

Default plain-text file where credentials are stored, one URL per line.
$XDG_CONFIG_HOME/git/credentials
Second lookup location, used only if ~/.git-credentials doesn't exist.

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

CAVEATS

Credentials are stored in plain text. Consider using a credential manager or git-credential-cache for better security.

SEE ALSO

Copied to clipboard
Kai