# 使用 Homebrew, apt, dnf, Nix 安装 git-secrets

查看 git-secrets 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:git-secrets
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install git-secrets
```

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install git-secrets
```

  证据: Debian stable package indexes: git-secrets from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install git-secrets
```

  证据: Fedora Rawhide package metadata: git-secrets from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#git-secrets
```

  证据: nixpkgs package indexes: pkgs/by-name/gi/git-secrets/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:git-secrets
- **软件包管理器:** Homebrew
- **版本:** 1.3.0
- **来源摘要:** Prevents you from committing sensitive information to a git repo
- **主页:** <https://github.com/awslabs/git-secrets>
- **仓库:** <https://github.com/awslabs/git-secrets>
- **最后更新:** 2026-08-02T20:52:06+09:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- git-secrets (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.3.0
## 项目历史与用法

git-secrets is an AWS Labs command-line tool that installs Git hooks and scans commits for prohibited secret patterns. Its best-known workflow is preventing AWS credentials and other sensitive strings from entering Git history.

### 项目历史

AWS Labs released git-secrets in 2015 as a hook-driven local scanner. The README documents pre-commit, commit-msg, and prepare-commit-msg hooks, as well as repository and global Git configuration for prohibited and allowed patterns.

The changelog shows rapid maturation after the initial release: 1.1.0 added full-history scanning, `.gitallowed`, cached/no-index/untracked scan modes, and staged-file scanning in hooks; 1.3.0 refined provider output handling, Windows path behavior, and IAM key detection.

### 采用历史

git-secrets became a recognizable package because it came from AWS Labs and addressed a common Git failure mode with no server dependency. Homebrew and Linux distribution packaging made it easy to add to developer workstations and repository templates.

### 使用方式

Practitioners run `git secrets --install` inside a repository, often followed by `git secrets --register-aws`, so commits are blocked when configured patterns are detected. They also run `git secrets --scan-history` before publishing a repository or add custom providers for organization-specific patterns.

### 为什么软件包爱好者会关心

The package is important in Git tooling culture because it turns secret scanning into local hooks and plain Git config. It is small, scriptable, and easy to wire into templates, which made it useful before and alongside hosted secret-scanning services.

### 时间线

- 2015: Repository created under AWS Labs.
- 2015: 1.0.0 initial release.
- 2016: 1.1.0 added full-history scans, `.gitallowed`, and more scan modes.
- 2016: 1.2.x fixed path and provider-command handling.
- 2019: 1.3.0 improved IAM key scanning and Windows path handling.

### Related projects

- Related tools and concepts include Git hooks, AWS credential files, organization-specific secret providers, repository templates, and other secret scanners used in pre-commit workflows.

### 来源

- <https://formulae.brew.sh/formula/git-secrets>
- <https://github.com/awslabs/git-secrets>
- <https://raw.githubusercontent.com/awslabs/git-secrets/master/CHANGELOG.md>
- <https://raw.githubusercontent.com/awslabs/git-secrets/master/README.rst>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: .git/config, ~/.gitconfig, ~/.config/git/config, /etc/gitconfig
## 其他软件包管理器记录

- Debian apt - git-secrets - 1.3.0-7: normalized package name match | Debian stable package indexes: git-secrets from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Prevents accidental commits of credentials | https://github.com/awslabs/git-secrets
- Nix - git-secrets: normalized package name match | nixpkgs package indexes: pkgs/by-name/gi/git-secrets/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - git-secrets - 1.3.0-7: normalized package name match | Ubuntu 24.04 LTS package indexes: git-secrets from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Prevents accidental commits of credentials | https://github.com/awslabs/git-secrets
- dnf - git-secrets - 1.3.0-18.fc45: normalized package name match | Fedora Rawhide package metadata: git-secrets from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Prevents committing secrets and credentials into git repos | https://github.com/awslabs/git-secrets/


## Combined YAML source

View the package source record on GitHub. [combined/git-secrets.yml](https://github.com/mxcl/pkgdb/blob/main/combined/git-secrets.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
