Linux command
git-credential 命令
网络
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Get credentials for a URL
echo "url=https://github.com" | git credential fill
说明
git credential is a low-level interface for storing and retrieving credentials using Git's credential helper system. It interfaces with configured helpers (cache, store, osxkeychain, manager, etc.) to retrieve, store, and erase credentials. The command is typically invoked automatically by Git during push/pull operations when authentication is needed. Direct use is primarily for debugging credential issues or scripting authentication workflows. Input and output use a key=value format on stdin/stdout with attributes like protocol, host, username, and password. Credential helpers are configured via git config credential.helper.
参数
- fill
- Read credential attributes from stdin, look up matching credentials via configured helpers, and output the result including username and password.
- approve
- Send credential attributes to all configured helpers for storage. No output is emitted.
- reject
- Notify all configured helpers to erase matching credentials. No output is emitted.
- --help
- Display help information.
FAQ
What is the git-credential command used for?
git credential is a low-level interface for storing and retrieving credentials using Git's credential helper system. It interfaces with configured helpers (cache, store, osxkeychain, manager, etc.) to retrieve, store, and erase credentials. The command is typically invoked automatically by Git during push/pull operations when authentication is needed. Direct use is primarily for debugging credential issues or scripting authentication workflows. Input and output use a key=value format on stdin/stdout with attributes like protocol, host, username, and password. Credential helpers are configured via git config credential.helper.
How do I run a basic git-credential example?
Run `echo "url=https://github.com" | git credential fill` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does fill do in git-credential?
Read credential attributes from stdin, look up matching credentials via configured helpers, and output the result including username and password.