An open API service indexing awesome lists of open source software.

https://github.com/roboloop/repo-rewriter

๐Ÿ› ๏ธ A set of scripts for making targeted adjustments in Git repositories ๐Ÿ™๐Ÿ“‚
https://github.com/roboloop/repo-rewriter

Last synced: 2 months ago
JSON representation

๐Ÿ› ๏ธ A set of scripts for making targeted adjustments in Git repositories ๐Ÿ™๐Ÿ“‚

Awesome Lists containing this project

README

          

# ๐Ÿงฌ Repo-Rewriter

> โš ๏ธ It's an educational project about GIT internals.
>
> It uses plumbing commands to achieve its goal.

`repo-rewriter` is a collection of small composable shell utilities designed to help you **explore, modify, and sign** Git repositories.
Everything is written in shell, with minimum external dependencies beyond Git itself.

## โœจ Features

- **History exploration**
- `find_in_*` โ€“ search in blobs, commits, or filepaths
- `print_authors` โ€“ list all commit authors
- `print_files` โ€“ show all tracked files

- **Automated rewriting**
- `drop_*` โ€” drop files by patterns, blobs by ids
- `replace_in_*` โ€“ perform safe text replacements in blobs, commits, or filepaths
- `rewrite_authors` โ€“ map and normalize author identities
- `rewrite_timestamps` โ€“ unify all timestamps to UTC
- `sign_commits` โ€“ cryptographically sign all commits with your GPG key

- **Interactive history rebuild**
- `rewrite_history` โ€“ step-by-step reconstruction of a linear repository
(supports pick/commit/skip/rollback/finalize/abort flow)

- **Portable & transparent**
- POSIX-compliant shell (works on macOS and Linux)
- Self-documenting commands with `--help`

## ๐Ÿš€ Quick Start

```bash
# clone repository
git clone https://github.com/roboloop/repo-rewriter
cd repo-rewriter

# run any command, check docs --help
REPO_DIR="$(pwd)" ./bin/rewriter --help
REPO_DIR="$(pwd)" ./bin/rewriter print_authors --help
REPO_DIR="$(pwd)" ./bin/rewriter print_authors
````

All commands respect a single required environment variable:

| Variable | Description |
| ---------- | ------------------------------- |
| `REPO_DIR` | Path to the Git repository root |

## โœ๏ธ TODO

- Installation script
- Reflog support
- Shellcheck
- Tests

## ๐Ÿงพ License

MIT ยฉ 2025 โ€” Crafted with โค๏ธ in pure shell.