Like .gitignore, but for what goes public. Keep a sanitized public mirror of your private repo.
Project description
git-private2public
Like .gitignore, but for what goes public.
You have a private repo. You want a public one — without the secrets. This tool keeps them in sync. Automatically.
Quick start
pip install git-filter-repo pyyaml
git-private2public init # creates .gitpublic/ folder
Edit .gitpublic/config — set source + target:
source = you/private-repo
target = you/public-repo
Edit .gitpublic/ignore — files to hide, one per line (like .gitignore):
.env
secrets/
*.key
Publish:
git-private2public publish
Done. Your public repo is clean.
Auto-publish on every git push
git-private2public hook enable # on
git push # also publishes public mirror
git-private2public hook disable # off
Native git hook. No CI, no GitHub Actions. Works offline.
The .gitpublic/ folder
Each file is one concern. Like .gitignore — one rule per line, # for
comments. If a file is missing, that setting is just empty.
| File | What goes in it | Format |
|---|---|---|
config |
source, target, push settings | key = value |
ignore |
files to NOT publish | one path/glob per line |
replace |
find → replace in file contents | old ==> new per line |
scan |
refuse to push if matched | one pattern per line |
allow |
domains OK to publish | one per line |
Easy — just edit ignore:
.env
secrets/
*.key
Medium — also edit replace:
10.0.0.5 ==> 203.0.113.5
real-token ==> ***
regex:[A-Fa-f0-9]{64} ==> ***
Hard — also edit scan + allow:
# scan:
regex:github_pat_[A-Za-z0-9_]{30,}
regex:192\.168\.
# allow:
get.docker.com
Commands
init create config
scan check, don't push
publish clean + push
hook enable / disable / status
Install
pip install git-private2public
That's it. Now you have the git-private2public command.
No pip? Single-file manual install — download +
chmod +x(needspip install git-filter-repo pyyaml).
Why
Git has no "private file in a public repo". So you need two repos. This keeps them in sync — without leaking.
| delete files | replace text | scan | auto push | |
|---|---|---|---|---|
| git-filter-repo | ✅ | ✅ | ❌ | ❌ |
| BFG | ✅ | ✅ | ❌ | ❌ |
| dupligit | ❌ | ❌ | ❌ | ✅ |
| git-private2public | ✅ | ✅ | ✅ | ✅ |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git_private2public-0.1.0.tar.gz.
File metadata
- Download URL: git_private2public-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b43740cfa4988c8b388fed8d306133b2ea210f025662a2ee6e128b422462c730
|
|
| MD5 |
9f4cd9bab82fd55d4044c38826e3eeed
|
|
| BLAKE2b-256 |
a29a553f9305b61827ebc815790f26d1cd956101040a7be3157ff1f1ee4604f7
|
File details
Details for the file git_private2public-0.1.0-py3-none-any.whl.
File metadata
- Download URL: git_private2public-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62f0c8df8735ad3903510ba1c0d044937dc4af5a2b4d4fd7172d51ac3aa0a991
|
|
| MD5 |
e663e72815167a89df74503f2a66ffc6
|
|
| BLAKE2b-256 |
1b0cf169272796a1c75601a54e8a4573b82f70ff44a33a0b93d7d316e989bb1b
|