Skip to main content

Dead simple, invisible git mirroring utility.

Project description

gitecho

The invisible, decentralized git mirror.

gitecho (alias ge) is a "set-and-forget" utility that automatically mirrors your git pushes to other providers (GitLab, Bitbucket, Gitea, or custom servers) in the background.

Motivation

We rely too heavily on GitHub. When it goes down, half the world's open-source development stops.

I built gitecho because existing mirroring tools are flawed:

  • CI/CD Pipelines: Too complex. Requires managing secrets and YAML for every single project.
  • Cron Jobs: Too slow. Code is mirrored minutes or hours later.
  • Manual Scripts: Too tedious. You forget to run them.

My goal was an Invisible Utility: something you configure once per project and then never think about again. You push to origin as usual, and gitecho handles the redundancy instantly.


Installation

Recommended (uv)

Install uv first: https://docs.astral.sh/uv/getting-started/installation/

Then install gitecho in an isolated tool environment:

uv tool install gitecho

For local development from this repository, prefer editable install so code changes are picked up immediately:

uv tool install --force --editable .

If you already installed from --from . and need a hard refresh:

uv tool install --force --reinstall --refresh --from . gitecho

If ge is not found after install, add ~/.local/bin to your shell PATH:

source "$HOME/.local/bin/env"

To make this permanent on zsh:

echo 'source "$HOME/.local/bin/env"' >> ~/.zshrc
source ~/.zshrc

Standard (pip)

pip install gitecho

Enable Autocomplete

Get tab completion for commands like sync or logs.

ge --install-completion

Authentication (Important)

Since gitecho runs in the background, it cannot ask you for a password. It must be able to push silently.

In background mode, gitecho disables interactive git prompts (GIT_TERMINAL_PROMPT=0, SSH batch mode). If auth is missing, it fails fast and writes the reason to ge logs.

1. SSH (Best) If you use SSH URLs (e.g., git@gitlab.com:user/repo.git) and your key is loaded, it works out of the box.

2. HTTPS (Requires Credential Helper) If you use HTTPS URLs (e.g., https://gitlab.com/user/repo.git), you must enable the Git Credential Helper so gitecho can read your saved token.

  • Mac: git config --global credential.helper osxkeychain
  • Windows: git config --global credential.helper manager
  • Linux: git config --global credential.helper store (or libsecret)

Test it: If git push echo-gitlab-com works in your terminal without typing a password, gitecho will work.


Usage

1. Setup a Mirror

Go to your project and link a backup repository.

cd ~/my-project
ge add git@gitlab.com:username/my-project.git

Output: ✔ Linked echo-gitlab-com

If you upgraded gitecho and want to refresh the hook, run ge add again with the same URL.

Expected output (already linked case): Mirror already linked as <remote-name>. Example: Mirror already linked as echo-remote.

2. The Workflow

Just use git.

git push origin main

That's it. Your code goes to GitHub immediately. gitecho silently triggers a background process to push to echo-gitlab-com. By default, it captures the exact refs from pre-push, waits for the origin refs to appear, then mirrors those same refs.

3. Check Status (Optional)

If you want to verify the mirror is active:

ge status

Power User Features

Shell Integration (Starship / Zsh)

Want to see if your repo is mirrored right in your prompt? Use the --short flag. It returns if active, x if error, or nothing.

Example (.zshrc):

PROMPT="$PROMPT \$(ge status --short)"

Logs

Since the tool is invisible, failures (like a down server) are silent to avoid interrupting your flow. Check what happened in the background:

ge logs

Show more lines:

ge logs 30

Origin Rejection Policy

Default behavior is safety-first: if origin does not reflect the pushed refs within the timeout window, gitecho skips mirror push and logs a warning.

If you want best-effort mirroring even when origin might have rejected the push, set:

export GITECHO_CONTINUE_ON_ORIGIN_REJECT=1

Or for a single push:

GITECHO_CONTINUE_ON_ORIGIN_REJECT=1 git push origin main

Sync All

By default, the hook mirrors the exact refs from your push. To force a full sync of all branches and tags:

ge sync --all

Uninstalling

I believe tools should leave no trace. If you want to remove gitecho from a project:

ge nuke

This removes the pre-push hook and deletes all echo-* remotes from the local configuration.


Future Plans

  • Global Watch: Automatically mirror every repo in a specific directory (e.g., ~/dev).
  • Auto-Creation: Detect if the remote repo doesn't exist and create it via API automatically (skipping the "Create Project" step in the browser).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitecho-0.1.3.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitecho-0.1.3-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file gitecho-0.1.3.tar.gz.

File metadata

  • Download URL: gitecho-0.1.3.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for gitecho-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ea2f6b72145b7f3994eaf9cf3d3452b494a68250422d5a1d4520c385413ab2de
MD5 f2b90227d8c306606fa57d1524d10312
BLAKE2b-256 92aae3944424d9ac4bad32936d0249df67d7c3b34f4dfc898501f0754ddff269

See more details on using hashes here.

File details

Details for the file gitecho-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: gitecho-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for gitecho-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bd76c8446ccbef8ae37e32e55a3c3a59d46b66fb0cafa7bd555bcbc2cf024fb7
MD5 43245725f90e04e30cf539627c5dd531
BLAKE2b-256 4d4bc2be5b371505a1d2d75deb1a1c742cbd36ef7016f6c597556aadc9974d89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page