gstree
v0.0.2
Published
CLI to sync folders with separate GitHub repos. Like git subtree, but simpler.
Maintainers
Readme
gstree
CLI to sync folders with separate GitHub repos. Like git subtree, but simpler.
__ _ ___| |_ _ __ ___ ___
/ _` / __| __| '__/ _ \/ _ \
| (_| \__ \ |_| | | __/ __/
\__, |___/\__|_| \___|\___|
__/ |
|___/ git subtree managerInstall
npm install -g gstreePrerequisites
- GitHub CLI installed and authenticated (
gh auth login)
Usage
Initialize a synced repo
# Single folder
gst init packages/studio
# Multiple folders
gst init packages/studio,packages/web
# Use git subtree mode (single folder only)
gst init packages/studio --subtreeThis will:
- Create a new GitHub repo (prompts for org and name)
- Push current folder contents
- Track it in
.gstree.json
Push changes
# Push all tracked repos
gst push
# Push specific repo
gst push studioPull changes
# Pull all tracked repos
gst pull
# Pull specific repo
gst pull studioOther commands
gst # Show status
gst sync # Pull then push everything
gst save "message" # Commit + push everything
gst commit "message" # Add all + commit
gst list # List tracked repos
gst remove <name> # Remove from trackingModes
Copy mode (default)
- Simple file copying between repos
- No git subtree complexity
- Supports multiple folders
- Clean commit history
Subtree mode (--subtree)
- Uses git subtree under the hood
- Single folder only
- Maintains git history connection
Config
Tracked repos are stored in .gstree.json:
{
"subtrees": [
{
"name": "studio",
"remote": "https://github.com/org/repo-packages-studio.git",
"prefix": "packages/studio",
"prefixes": ["packages/studio"],
"branch": "main",
"mode": "copy"
}
]
}License
MIT
