Skip to content

Commit ca0d378

Browse files
authored
readme update (#2)
1 parent 3207a00 commit ca0d378

1 file changed

Lines changed: 28 additions & 14 deletions

File tree

‎README.md‎

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# git-sync-filtered
22

3+
![GitHub Repo stars](https://img.shields.io/github/stars/Merge-42/git-sync-filtered?style=social)
4+
![Python versions](https://img.shields.io/pypi/pyversions/git-sync-filtered)
5+
![License](https://img.shields.io/pypi/l/git-sync-filtered)
6+
37
A thin wrapper around [git-filter-repo](https://github.com/newren/git-filter-repo) for syncing filtered commits from a private repository to a public repository.
48

9+
## Overview
10+
11+
git-sync-filtered clones a private repository, filters it to only include specified paths using git-filter-repo, and pushes the result to a public repository's sync branch. This enables maintaining a public subset of a private repository while preserving commit history.
12+
513
## Installation
614

715
### uv (recommended)
@@ -36,9 +44,9 @@ git-sync-filtered \
3644
--keep docs
3745
```
3846

39-
Or use a file to specify paths:
47+
### Using a paths file
4048

41-
### paths.txt
49+
Create a file with paths to keep (one per line, lines starting with `#` are comments):
4250

4351
```text
4452
src
@@ -53,20 +61,22 @@ git-sync-filtered \
5361
--keep-from-file paths.txt
5462
```
5563

56-
### Options
64+
## Options
5765

58-
- `--private` - Private repo path or URL (required)
59-
- `--public` - Public repo path or URL (required)
60-
- `--keep` - Paths to keep (can specify multiple, required)
61-
- `--keep-from-file` - File containing paths to keep (one per line, lines starting with # are comments)
62-
- `--sync-branch` - Sync branch name (default: upstream/sync)
63-
- `--main-branch` - Main branch name (default: main)
64-
- `--private-branch` - Private branch to sync from (default: main)
65-
- `--dry-run` - Show what would happen without making changes
66-
- `--merge` - Merge into main branch after sync
67-
- `--force` - Force push
66+
| Option | Description | Default |
67+
| ------------------ | --------------------------------------------- | --------------- |
68+
| `--private` | Private repo path or URL | Required |
69+
| `--public` | Public repo path or URL | Required |
70+
| `--keep` | Paths to keep (specify multiple) | Required |
71+
| `--keep-from-file` | File containing paths to keep | - |
72+
| `--sync-branch` | Sync branch name | `upstream/sync` |
73+
| `--main-branch` | Main branch name | `main` |
74+
| `--private-branch` | Private branch to sync from | `main` |
75+
| `--dry-run` | Show what would happen without making changes | `false` |
76+
| `--merge` | Merge into main branch after sync | `false` |
77+
| `--force` | Force push | `false` |
6878

69-
## How it works
79+
## How It Works
7080

7181
1. Clones the private repository
7282
2. Runs git-filter-repo to filter to only the specified paths
@@ -88,3 +98,7 @@ flowchart LR
8898

8999
- Python 3.10+
90100
- git >= 2.36.0
101+
102+
---
103+
104+
Sponsored by [Merge 42](https://merge42.com)

0 commit comments

Comments
 (0)