Linux command
git-secret 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Initialize git-secret
git secret init
Add user by email
git secret tell [user@email.com]
Add file to encrypt
git secret add [secret.txt]
Encrypt secrets
git secret hide
Decrypt secrets
git secret reveal
List users who can access secrets
git secret whoknows
Decrypt and print a single file to stdout
git secret cat [secret.txt]
说明
git secret encrypts sensitive files for safe storage in Git repositories. Files are encrypted with GPG for specified recipients, allowing secrets to be version-controlled safely. The tool manages encryption, decryption, and recipient lists. Encrypted files (`.secret`) are tracked by Git while the original plaintext files are automatically added to `.gitignore`.
参数
- init
- Initialize git-secret in repo.
- tell _EMAIL_
- Add a GPG key holder who can decrypt secrets. Use -m to use git config user.email.
- add _FILE_
- Add a file to be encrypted. The plaintext file is automatically added to .gitignore.
- hide
- Encrypt all added secret files. Use -m to delete plaintext after encrypting.
- reveal
- Decrypt all secret files. Use -p _PASSWORD_ for non-interactive passphrase input.
- remove _FILE_
- Remove a file from the secret list.
- list
- List all secret files.
- whoknows
- List users who have access to secrets.
- changes _FILE_
- Show diff between plaintext and decrypted version of a file.
- cat _FILE_
- Decrypt and print a single secret file to stdout.
- removeperson _EMAIL_
- Remove a person from the secret access list.
- --help
- Display help information.
FAQ
What is the git-secret command used for?
git secret encrypts sensitive files for safe storage in Git repositories. Files are encrypted with GPG for specified recipients, allowing secrets to be version-controlled safely. The tool manages encryption, decryption, and recipient lists. Encrypted files (`.secret`) are tracked by Git while the original plaintext files are automatically added to `.gitignore`.
How do I run a basic git-secret example?
Run `git secret init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does init do in git-secret?
Initialize git-secret in repo.