# 使用 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
- **版本:** 2.2.5
- **来源摘要:** Customize your git commit hashes!
- **主页:** <https://github.com/not-an-aardvark/lucky-commit>
- **仓库:** <https://github.com/not-an-aardvark/lucky-commit>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- lucky_commit (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

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

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

- 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


## Combined YAML source

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


## 来源

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