https://github.com/stavxyz/gitmux
A git repository multiplexer. A monorepo surgeon?
https://github.com/stavxyz/gitmux
filter-branch git monorepo repository
Last synced: 5 months ago
JSON representation
A git repository multiplexer. A monorepo surgeon?
- Host: GitHub
- URL: https://github.com/stavxyz/gitmux
- Owner: stavxyz
- License: gpl-3.0
- Created: 2019-10-05T00:49:35.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2026-01-28T07:02:21.000Z (5 months ago)
- Last Synced: 2026-01-28T12:54:22.353Z (5 months ago)
- Topics: filter-branch, git, monorepo, repository
- Language: Shell
- Homepage: https://gitmux.com
- Size: 272 KB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# gitmux
[](https://github.com/stavxyz/gitmux/actions/workflows/ci.yml)
[](https://github.com/stavxyz/gitmux/releases/latest)
[](https://www.gnu.org/licenses/gpl-3.0)
[](https://gitmux.com)
**Extract files from one repo to another while preserving full git history.**
```bash
# Extract packages/auth from a monorepo into its own repo
./gitmux.sh -r github.com/company/monorepo -t github.com/company/auth-lib -d packages/auth -s
```
Every commit, every blame, every bisect — preserved.
**[Documentation](https://gitmux.com)** · **[Usage Reference](https://gitmux.com/usage.html)** · **[FAQ](https://gitmux.com/faq.html)**
---
## Why gitmux?
- **Full history** — Not a copy-paste. Every commit follows the code.
- **PR-based** — Changes go through pull requests, never direct pushes.
- **10x faster** — Auto-uses [git-filter-repo](https://github.com/newren/git-filter-repo) when available.
- **Multi-path** — Migrate multiple directories in one operation.
## Install
```bash
git clone https://github.com/stavxyz/gitmux.git
cd gitmux && ./gitmux.sh -h
```
**Optional** (10x speedup): `brew install git-filter-repo` or `pip install git-filter-repo`
## Quick Start
### Extract a subdirectory
```bash
./gitmux.sh \
-r https://github.com/source-owner/monorepo \
-t https://github.com/dest-owner/extracted-lib \
-d packages/my-library \
-s # Submit PR automatically
```
### Migrate multiple paths
```bash
./gitmux.sh \
-r https://github.com/source/monorepo \
-t https://github.com/dest/new-repo \
-m 'src/lib:packages/lib' \
-m 'tests/lib:packages/lib/tests' \
-s
```
### Rewrite authorship
```bash
./gitmux.sh \
-r source -t dest \
--author-name "Your Name" \
--author-email "you@example.com" \
--coauthor-action claude \
-s
```
## How It Works
```
┌─────────────┐ ┌─────────────┐
│ Source │ ──── filter ────▶ │ Filtered │
│ Repository │ │ Content │
└─────────────┘ └──────┬──────┘
│
rebase onto
│
▼
┌─────────────┐ ┌─────────────┐
│ Destination │ ◀── pull request ── │ Feature │
│ Branch │ │ Branch │
└─────────────┘ └─────────────┘
```
1. **Clone** source to temp workspace
2. **Filter** to extract selected content (preserves history)
3. **Rebase** onto destination branch
4. **Push** to feature branch
5. **PR** via GitHub CLI (optional)
## Documentation
Full documentation available at **[gitmux.com](https://gitmux.com)**:
- [Usage Reference](https://gitmux.com/usage.html) — All CLI options and environment variables
- [Rebase Strategies](https://gitmux.com/rebase-strategies.html) — Conflict resolution and diff algorithms
- [Filter Backend](https://gitmux.com/filter-backend.html) — filter-repo vs filter-branch
- [FAQ](https://gitmux.com/faq.html) — Common questions answered
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
## License
[GPL-3.0](LICENSE) — Free software. Share improvements.
---
**[gitmux.com](https://gitmux.com)** · **[Issues](https://github.com/stavxyz/gitmux/issues)** · **[Email](mailto:hi@stav.xyz)**