Sync tagged releases from a private repository to a public LIVE repository with clean, rewritten history.
GitLive publishes commits tagged with live/* from your private repository to a public LIVE repository. Each tag becomes a squashed commit in the LIVE repo, hiding your development history while preserving release content.
dotnet publish -c Release -r <runtime> -o <output-dir>Common runtimes: linux-x64, win-x64, osx-x64, osx-arm64
Example:
dotnet publish -c Release -r linux-x64 -o ./bin
export PATH="$PATH:$(pwd)/bin"No installation needed. Use directly in workflows with Racso/git-live@main.
git-live --url=https://github.com/user/public-repo.git--incremental(default) - Sync only new tags after the last published commit--repair- Scan all tags and sync any missing ones. Use after modifying repo history (rebases, force-pushes) or tag modifications that desynced the tag history--nuke- Delete all LIVE tags and completely rebuild the repository. Use after major history rewrites or to fix severe desynchronization
--dry-run- Preview changes without pushing to LIVE repository--url=<url>- Specify the LIVE repository URL (can also useGITLIVE_URLenv var orgitlive.z0config file)--user=<username>- Username for authentication--password=<password>- Password/token for authentication--config-file=<path>- Path to config file (default:gitlive.z0)
-vor--verbose- Show detailed progress information-vvor--very-verbose- Show all operations and debug information
Environment Variables (Recommended):
export GITLIVE_USER="username"
export GITLIVE_PASSWORD="ghp_token123"
git-live --url=https://github.com/user/public-repo.gitCLI Arguments:
git-live --url=https://github.com/user/repo.git --user=username --password=tokenConfiguration File:
public-url = https://github.com/user/public-repo.git
user = username
Priority: CLI arguments > Environment variables > Configuration file
Note: Passwords cannot be stored in gitlive.z0 for security reasons.
Create gitlive.z0 in your repository root:
public-url = https://github.com/user/public-repo.git
user = myusername
files:
# = - secret.txt
# = - internal/
# = - *.key
Then simply run:
git-liveControl which files sync to LIVE using ordered add (+) and remove (-) rules.
Starting State:
- First rule
+: Start empty, only added files included - First rule
-: Start with all files, only removed files excluded
Examples:
Sync only documentation:
files:
# = + *.md
# = + docs/*.txt
Sync all except secrets:
files:
# = - secret.txt
# = - .env
# = - *.key
# = - internal/
Sync images except one:
files:
# = + *.png
# = + *.jpg
# = - logo-draft.png
Sync source code excluding tests:
files:
# = + src/*.cs
# = - src/*Test.cs
Create .github/workflows/sync-live.yml:
name: Sync to LIVE
on:
push:
tags:
- 'live/*'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Sync to LIVE
uses: Racso/git-live@main
env:
GITLIVE_USER: ${{ vars.GITLIVE_USER }}
GITLIVE_PASSWORD: ${{ secrets.GITLIVE_PASSWORD }}This is a minimal example. For a full-fledged workflow with inputs and other quality-of-life improvements, see the example file in .github/workflows/
The action supports the following inputs. They are especially useful when running the action manually via workflow dispatch.
live-url- URL of the LIVE repository (can be omitted if usinggitlive.z0config file orGITLIVE_URLenv var)mode- Sync mode:incremental,repair, ornuke(default:incremental)dry-run- Preview without pushing:trueorfalse(default:false)verbosity- Verbosity level:normal,verbose, orvery-verbose(default:normal)config-file- Path to config file (optional)
- Create a Personal Access Token at https://github.com/settings/tokens with
reposcope - Add as repository secret:
LIVE_TOKEN - Add username as repository variable:
GITLIVE_USER(Settings → Secrets and variables → Actions → Variables) - Add password as repository secret:
GITLIVE_PASSWORD - Update
live-urlwith your repository
git tag live/1.0.0
git push origin live/1.0.0If using GitHub Actions, the workflow triggers automatically. For CLI:
git-live --url=https://github.com/user/public-repo.gitgit-live --url=https://github.com/user/repo.git --dry-run -vAfter rebasing or force-pushing, tags may desync. Use repair mode:
git-live --url=https://github.com/user/repo.git --repairAfter major history rewrites or severe issues:
git-live --url=https://github.com/user/repo.git --nuke -vcat > gitlive.z0 << 'EOF'
public-url = https://github.com/user/public-repo.git
user = myusername
files:
# = - .env
# = - secrets/
EOF
export GITLIVE_PASSWORD="token"
git-live- Identifies all
live/*tags in source repository - Creates a temporary git repository
- For each tag, creates a squashed commit with the tag's content
- Pushes commits and tags to LIVE repository
- Each commit contains metadata linking to the original
Tags in LIVE have the prefix removed: live/1.0.0 → 1.0.0
Problem: "No new tags to publish" message appears.
Solutions:
- Verify tags exist:
git tag | grep "^live/" - Check tags are fetched:
git fetch --tags - Try repair mode:
git-live --repair - Use verbose mode to see details:
git-live -vv
Problem: Push fails with authentication error.
Solutions:
- Verify credentials are set correctly
- For GitHub, use Personal Access Token, not password
- Check token has
reposcope - Test credentials:
git ls-remote https://token@github.com/user/repo.git - Use very verbose mode:
git-live -vv
Problem: LIVE repository has different tags than expected.
Solutions:
- Use repair mode to resync:
git-live --repair - If severely desynced, use nuke mode:
git-live --nuke - Verify tags in both repos:
git ls-remote --tags <url>
Problem: Unwanted files appear in LIVE repository.
Solutions:
- Review file selection rules in
gitlive.z0 - Remember first rule determines starting state
- Test with dry-run:
git-live --dry-run -v - If already pushed, fix rules and use:
git-live --nuke
Problem: After rebasing, force-pushing, or modifying tags, LIVE repository is out of sync.
Cause: Git history modifications change commit hashes, breaking the link between source and LIVE tags.
Solutions:
- Use repair mode to resync missing tags:
git-live --repair - For major issues, rebuild completely:
git-live --nuke - Avoid rewriting history of already-published tags
Problem: GitHub Actions workflow doesn't run when pushing tags.
Solutions:
- Verify workflow file is in
.github/workflows/ - Check tag matches pattern:
live/* - Ensure workflow is on default branch
- Check workflow run history for errors
- Verify repository secrets/variables are set
Problem: Dry run output shows different changes than expected.
Solutions:
- Use very verbose mode:
git-live --dry-run -vv - Check file selection rules
- Verify which tags are being processed
- Compare with LIVE:
git ls-remote --tags <live-url>
- .NET 9.0 or later
- Git 2.0 or later
- Read access to source repository
- Write access to LIVE repository