gitkat-rewrite

Crates.iogitkat-rewrite
lib.rsgitkat-rewrite
version0.5.2
created_at2025-12-23 11:38:02.054263+00
updated_at2025-12-23 11:38:02.054263+00
descriptionGitKat git history rewrite engine built on gitoxide
homepage
repositoryhttps://github.com/Aureuma/GitKat
max_upload_size
id2001356
size85,068
Shawn Azdam (SHi-ON)

documentation

README

β«·β«Έ

π”Ύπš’πšπ•‚πšŠπš β«·β«Έ

CI GitHub

π”Ύπš’πšπ•‚πšŠπš β«·β«Έ (GitKat) is a Rust toolkit for managing Git repositories in bulk. It ships a single CLI, gk, that mirrors the legacy shell scripts while adding a packaged, testable workflow.

Install

# crates.io
cargo install gitkat

# Homebrew (tap this repo)
brew install Aureuma/gitkat/gitkat

# npm
npm install -g @aureuma/gitkat

# pip (Python wrapper downloads the Rust binary)
python -m pip install gitkat

# local builds
cargo build --release
./target/release/gk --help

The pip/npm wrappers download the Rust binary from GitHub Releases on first run. Set GITKAT_RELEASE_BASE to override the download base URL.

Quick start

gk check "Example Name"
gk report .
gk push
gk rewrite -m olddomain.com:newdomain.com --ignore-case --preserve-case
gk github-emails --token YOUR_GITHUB_TOKEN

Commands

  • gk check <name>: search author and committer names across repos in the current directory.
  • gk report [path]: list unique author emails for each repo under a path.
  • gk push: force-push the current branch of each repo in the current directory.
  • gk rewrite: rewrite identity metadata and/or blob contents using a Rust gitoxide (gix) rewriter.
  • gk github-emails --token <token>: find contribution emails across GitHub repos you can access.
  • gk verify-rewrite: compare rewrite output against git-filter-repo across real repositories.

Rewrite notes

gk rewrite preserves the existing behavior of rewrite.sh, including case-aware blob mapping and commit metadata rewrites. The rewrite engine is implemented directly in Rust using gitoxide (gix).

Examples:

# Identity rewrite
gk rewrite -n "New Name" -e "new@example.test" -o "old@example.test"

# Blob rewrite with preserved casing and case-insensitive matching
gk rewrite -m foo:bar --ignore-case --preserve-case

# Regex blob rewrite
gk rewrite -m "token_[0-9]+:REDACTED" --regex

# Exclude files from blob rewrites
gk rewrite -m token:REDACTED -x "data/*.csv" -x "vendor/*"

# Rename file paths using the same mappings
gk rewrite -m oldname:newname --rename-files

# Delete a file or glob across history
gk rewrite --delete-path "path/to/file.txt"
gk rewrite --delete-path "assets/**/*.png"

Delete paths accept glob patterns and log each removed file in the colored rewrite output.

Development

cargo test --workspace
cargo run -p gitkat -- --help
gk verify-rewrite --ci --with-blob
mdbook build

gk verify-rewrite compares against git-filter-repo, so install it if you want equivalence checks.

License

MIT License. See LICENSE.

Commit count: 0

cargo fmt