gitlulz helps you set up local bare Git remotes and back them up as verified portable bundles that can be cloned back at any time. It has no runtime dependencies beyond git itself: every command shells out to git.
Important
I built this project for my personal usecase. And I'm not taking PRs for now. Please fork it if you want to change something. (The project is under GNU General Public License v3.0 only license).
- Set up a local bare Git remote in one command
- Back up an entire remote as a verified, portable bundle
- Restore a remote from a backup
- Automatic pruning of old backups (configurable)
- No daemon, no mount, no custom protocol; just
git
Grab the right file from the releases page, then:
# Linux example chmod +x gitlulz-*-linux-amd64 sudo mv gitlulz-*-linux-amd64 /usr/local/bin/gitlulz # macOS example (Apple Silicon) chmod +x gitlulz-*-darwin-arm64 sudo mv gitlulz-*-darwin-arm64 /usr/local/bin/gitlulz # Termux example (Android) chmod +x gitlulz-*-android-arm64 mv gitlulz-*-android-arm64 $PREFIX/bin/gitlulz
# Windows example (PowerShell) # Move it to a folder that is in your PATH, e.g., C:\Users\YourName\bin Move-Item .\gitlulz-*-windows-amd64.exe C:\Users\YourName\bin\gitlulz.exe
# Build & install git clone https://github.com/SmileLulz/gitlulz cd gitlulz ./build.sh arch sudo pacman -U dist/gitlulz-*.pkg.tar.zst # Or grab the '.pkg.tar.zst' from releases # and install it with 'pacman -U'
# Build & install git clone https://github.com/SmileLulz/gitlulz cd gitlulz ./build.sh deb sudo dpkg -i dist/gitlulz_*.deb # Or grab the '.deb' from releases # and install it with 'dpkg -i'
# Build & install git clone https://github.com/SmileLulz/gitlulz cd gitlulz ./build.sh rpm sudo dnf install dist/gitlulz-*.rpm # Or grab the '.rpm' from releases # and install it with 'dnf install'
# Build & install pkg install golang git git clone https://github.com/SmileLulz/gitlulz cd gitlulz bash build.sh go mv gitlulz $PREFIX/bin/gitlulz # Or grab the prebuilt binary from releases and install it chmod +x gitlulz-*-android-arm64 mv gitlulz-*-android-arm64 $PREFIX/bin/gitlulz
git clone https://github.com/SmileLulz/gitlulz cd gitlulz ./build.sh go # The binary lands at ./gitlulz
| Command | What it does |
|---|---|
gitlulz init <path> |
Create a bare repo (appends .git unless --no-git-suffix) |
gitlulz info <path> |
Show HEAD, branches, tags |
gitlulz backup <path> |
Full --all HEAD bundle + verify + manifest |
gitlulz restore <bundle> <dest> |
Clone a bare repo back from a bundle |
gitlulz verify <bundle> |
Verify a bundle independently |
gitlulz version |
Version info |
The .git suffix is a convention, not a requirement, but it signals "this is a remote, not a checkout". init appends it automatically unless you pass --no-git-suffix, and backup trims it when naming files, so /GitRemotes/my-project.git and /GitRemotes/my-project behave identically and both produce my-project-... backups.
gitlulz init /GitRemotes/my-project # in a working repo: git remote add local /GitRemotes/my-project.git && git push -u local main gitlulz backup /GitRemotes/my-project.git # -> /GitRemotes/my-project.backups/my-project-YYYYMMDDTHHMMSSZ.bundle # + .manifest.json with SHA-256, size, refs, git/tool version # restore anywhere: gitlulz restore \ /GitRemotes/my-project.backups/my-project-YYYYMMDDTHHMMSSZ.bundle \ /tmp/restored.git
Override the output directory with -o/--output and the filename prefix with --prefix:
gitlulz backup /GitRemotes/my-project.git -o /mnt/nas/git-backups
Bundles are read-only archives; use gitlulz verify <bundle> to check one independently, and gitlulz restore to clone it back. A backup of an empty remote writes only a manifest with "empty": true, and no bundle.
- All refs (
refs/heads/*,refs/tags/*,refs/remotes/*) plus every object reachable from them, viagit bundle create ... --all HEAD. HEADis included explicitly, so the default branch is preserved.- Not included: reflogs,
.git/config, hooks,refs/notes/*, or unreachable objects. Copy those files separately if you need them.
Each bundle is verified with git bundle verify before it is renamed into place, and the manifest is written atomically after the bundle, so readers never see a half-written backup.
backup reads an optional YAML config file from:
$XDG_CONFIG_HOME/gitlulz/config.yaml(whenXDG_CONFIG_HOMEis set), or~/.config/gitlulz/config.yaml(Linux, macOS, Termux), or%APPDATA%\gitlulz\config.yaml(Windows)
On first run, the tool writes a default config.yaml to that location. Delete the file to reset to defaults; the next command recreates it. --help and bare gitlulz (no subcommand) do not create it, so the file appears the first time you actually run a command.
# Keep at most 3 backups per remote+prefix combination. # 0 means unlimited (pruning disabled). Default is 3. max_backups: 3
Pruning runs after each successful backup, never before: if git bundle create or git bundle verify fails, no old backups are touched. Files considered for pruning are those matching <prefix>-*.manifest.json in the backup's output directory, so backups of different remotes, or of the same remote into different -o directories, are pruned independently. Empty-repo backups (manifest only, no bundle) are counted the same as full backups.
Override the config for a single run:
gitlulz backup /GitRemotes/my-project.git --max-backups 0 # unlimited gitlulz backup /GitRemotes/my-project.git --max-backups 10 # keep 10
A malformed config file is a hard error: the run stops before creating a backup, so a typo in config.yaml never silently falls back to the default of 3.
The config path moved from ~/.config/gitlulz-local/config.yaml to ~/.config/gitlulz/config.yaml. The first gitlulz command automatically copies the old file to the new location if the new one does not exist yet. The old file is left in place so you can inspect it before deleting.
./test.sh # Linux / macOS ./test-on-termux.sh # Termux test.bat # Windows
Each script checks that every command it invokes is present before building or running anything, and reports all missing ones at once with a platform-appropriate install hint (pacman/apt/dnf/zypper/apk on Linux, brew/port on macOS, pkg install on Termux, and bash.exe/git.exe/go.exe lookups on Windows). A bare machine fails with a single readable message instead of a half-finished run.
Set KEEP=1 to keep the temp directory for inspection. On Windows, test.bat locates bash.exe from your Git for Windows install and runs test.sh. Each script isolates HOME and XDG_CONFIG_HOME inside the temp directory, so the config tests never touch your real config file.
./build.sh go # native binary at ./gitlulz ./build.sh test # go test ./... ./build.sh cross # cross-compile everything into ./dist ./build.sh linux # Linux targets only ./build.sh darwin # macOS targets only ./build.sh windows # Windows targets only ./build.sh termux # Termux (android/arm64) ./build.sh arch # Arch package (needs makepkg) ./build.sh deb # Debian .deb ./build.sh rpm # Fedora .rpm
build.sh works on Linux and macOS unchanged. On Windows, use build.bat; it handles go and cross natively, and the package commands just tell you they are Linux-only.
Cross targets: linux/{amd64,arm64,arm,riscv64}, darwin/{amd64,arm64}, windows/{amd64,arm64}, android/arm64 (Termux).