Skip to content

SkyeVoyant/RepoPush

Repository files navigation

RepoPush (Open Source)

RepoPush is a small daemon that watches local folders, commits file changes, and pushes those commits to GitHub on a schedule.

If you work across multiple repos and want "always backed up" without a full CI pipeline, this is what it does.

What It Does

  • Watches configured folders with chokidar
  • Auto-initializes Git in folders that do not have .git yet
  • Commits local changes after a debounce window
  • Pushes every configured interval
  • Can auto-create missing private GitHub repos (if token permissions allow it)
  • Hot-reloads .env changes without restart

How Sync Works

  1. File change detected
  2. Debounce timer waits for activity to settle
  3. RepoPush runs git add -A + commit
  4. Timed push cycle sends commits to GitHub

Pushes are serialized so overlapping push intervals do not stack process/memory usage.

Requirements

  • Node.js 18+ (for local run) or Docker
  • Git installed
  • GitHub fine-grained token with:
    • Contents: Read and write (required)
    • Metadata: Read (required)
    • Administration: Read and write (optional, only for auto-creating repos)

Quick Start

cd repopush
cp .env.example .env
# edit .env
docker compose up -d --build

Logs:

docker logs RepoPush -f

Configuration

RepoPush reads .env in simple key/value format.

# GitHub token
token=ghp_...

# Commit identity
git_author_name=Your Name
git_author_email=you@example.com

# Push interval (minutes)
sync_time=60

# Commit debounce (milliseconds)
commit_debounce_ms=3000

# Project 1
gitlink=https://github.com/yourname/project-one
gitlocation=/absolute/path/project-one

# Project 2
gitlink=https://github.com/yourname/project-two
gitlocation=/absolute/path/project-two

Notes:

  • gitlink + gitlocation entries are paired in order.
  • gitlocation must be an absolute path.
  • For GitHub contribution graph credit, git_author_email must be a verified email on your GitHub account.

Hot Reload

RepoPush watches .env and reloads config automatically.

You can:

  • Add/remove projects
  • Change sync_time
  • Change commit_debounce_ms
  • Rotate token/author info

Reloads are debounced and processed sequentially to avoid overlapping reload work.

Docker Commands

# Start
docker compose up -d --build

# Stop
docker compose down

# Follow logs
docker logs RepoPush -f

Troubleshooting

Nothing is being committed

  • Check path in gitlocation
  • Check .gitignore rules in that repo
  • Check logs for commit errors

Push failed

  • Validate token scopes
  • Validate repo access
  • Confirm remote URL in gitlink

Repo was not auto-created

  • Add Administration: Read and write permission
  • Or create the repo manually, then keep same gitlink

Too many tiny commits

  • Increase commit_debounce_ms (for example 10000)

Security Notes

  • Never commit .env
  • Use least-privilege tokens
  • RepoPush uses token-authenticated HTTPS remotes for pushes

License

GPL-2.0-only

About

Automatically syncs local git repositories to GitHub using fine-grained tokens. Supports multiple projects, configurable sync intervals, and runs in Docker. Reads config fresh on every sync.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors