# 使用 Homebrew, MacPorts, Nix, pacman 安装 lucky-commit

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

## 安装

```sh
sudo av install brew:lucky-commit
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install lucky-commit
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install lucky-commit
```

  证据: MacPorts ports tree: devel/lucky-commit/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#lucky-commit
```

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

- pacman (92%):

```sh
sudo pacman -S lucky-commit
```

  证据: Arch Linux sync databases: lucky-commit from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

## 软件包事实

- **软件包键:** brew:lucky-commit
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/lucky-commit>
- **版本:** 2.2.5
- **来源摘要:** Customize your git commit hashes!
- **主页:** <https://github.com/not-an-aardvark/lucky-commit>
- **仓库:** <https://github.com/not-an-aardvark/lucky-commit>
- **上游文档:** <https://github.com/not-an-aardvark/lucky-commit#readme>
- **许可证:** MIT
- **源码归档:** <https://github.com/not-an-aardvark/lucky-commit/archive/refs/tags/v2.2.5.tar.gz>
- **已生成:** 2026-07-08T18:08:21+00:00

## 可执行文件

- lucky_commit (cli)
- lucky_commit (别名)

## 构建依赖

- rust

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 2.2.5
- 本地数据: OK
- 上游仓库: https://github.com/not-an-aardvark/lucky-commit
- 检测到的最新版本: v2.2.5 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

lucky-commit is a small Rust command-line tool for rewriting the current Git commit so that its object hash begins with a chosen prefix, defaulting to a run of zeroes.

### 项目历史

The project was made public on GitHub in February 2016. Its README explains the core trick: amend the commit message by appending harmless whitespace, retrying messages until Git computes a hash with the requested prefix. The current implementation is Rust-based and can use OpenCL for GPU-accelerated searching, while older branches preserve earlier Node.js, C, and pure-Rust implementations.

### 采用历史

The tool spread as a programmer curiosity rather than infrastructure. Official installation notes mention Cargo, Arch Linux, Funtoo, and Homebrew packaging, and the repository has roughly two thousand GitHub stars, which is notable for a deliberately niche Git-hash novelty.

### 使用方式

Users run `lucky_commit` after creating a commit; the command amends the commit until the short hash matches a prefix such as `0000000` or a user-supplied pattern with wildcard placeholders. The README also documents benchmarking and behavior for GPG-signed commits and Git SHA-256 repositories.

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

For package and Git nerds, lucky-commit is a compact demonstration that commit IDs are content-addressed objects but still manipulable by changing semantically inert data. Its Homebrew formula gives macOS users an easy way to install a tool that is mostly useful for demos, badges, jokes, and understanding Git object hashing.

### 时间线

- 2016: Public GitHub repository created.
- 2016 onward: Cargo installation documented as the primary upstream installation path.
- Later releases: Rust/OpenCL implementation became the maintained branch, with older Node.js, C, and pure-Rust branches kept as historical alternatives.
- Current packaging: Official README documents availability through Arch Linux, Funtoo, and Homebrew.

### Related projects

- The README points to `every-git-commit-shorthash` as a related project.
- The project depends conceptually on Git object hashing and, for acceleration, OpenCL-capable hardware.

### 来源

- <https://api.github.com/repos/not-an-aardvark/lucky-commit>
- <https://formulae.brew.sh/formula/lucky-commit>
- <https://github.com/not-an-aardvark/lucky-commit>


## 安全说明

narrow executable package without higher-risk signals.

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

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** lucky-commit
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Nix - lucky-commit: normalized package name match | nixpkgs package indexes: pkgs/by-name/lu/lucky-commit/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - lucky-commit - 2.2.5-1: normalized package name match | Arch Linux sync databases: lucky-commit from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Customize your git commit hashes | https://github.com/not-an-aardvark/lucky-commit
- MacPorts - lucky-commit: normalized package name match | MacPorts ports tree: devel/lucky-commit/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Source-control packages](https://www.automicvault.com/zh-hans/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/zh-hans/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/zh-hans/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [rust](https://www.automicvault.com/zh-hans/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [commitizen](https://www.automicvault.com/zh-hans/pkg/brew/commitizen/) - Shares av.db curated category or tags: cli, commits, developer-tools, git, version-control.
- [git-quick-stats](https://www.automicvault.com/zh-hans/pkg/brew/git-quick-stats/) - Shares av.db curated category or tags: cli, commits, developer-tools, git, version-control.
- [gitnr](https://www.automicvault.com/zh-hans/pkg/brew/gitnr/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, git, version-control.
- [gource](https://www.automicvault.com/zh-hans/pkg/brew/gource/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, git, version-control.
- [grokmirror](https://www.automicvault.com/zh-hans/pkg/brew/grokmirror/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, git, version-control.
- [karn](https://www.automicvault.com/zh-hans/pkg/brew/karn/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, git, version-control.
- [ugit](https://www.automicvault.com/zh-hans/pkg/brew/ugit/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, git, version-control.
- [aicommit](https://www.automicvault.com/zh-hans/pkg/brew/aicommit/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [conventional-commits-detector](https://www.automicvault.com/zh-hans/pkg/npm/conventional-commits-detector/) - Local package facts share a topical domain. Shared terms: cli, commit, commits, control, developer.
- [devmoji](https://www.automicvault.com/zh-hans/pkg/npm/devmoji/) - Local package facts share a topical domain. Shared terms: cli, commit, commits, control, developer.

## Combined YAML source

View the package source record on GitHub. [combined/lucky-commit.yml](https://github.com/automic-vault/db/blob/main/combined/lucky-commit.yml)


## 来源

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
