GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - SmileLulz/gitlulz: A simple utility CLI for hosting local Git remotes and backing them up safely.

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
packaging
packaging
 
 
scripts
scripts
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
TODO.md
TODO.md
 
 
VERSION
VERSION
 
 
build.bat
build.bat
 
 
build.sh
build.sh
 
 
clean.bat
clean.bat
 
 
clean.sh
clean.sh
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
test-on-termux.sh
test-on-termux.sh
 
 
test.bat
test.bat
 
 
test.sh
test.sh
 
 

Repository files navigation

gitlulz

A simple utility CLI for hosting local Git remotes and backing them up safely.

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).


Features

  • 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

Install

Prebuilt binaries

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

Arch Linux

# 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'

Debian / Ubuntu

# 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'

Fedora / RHEL

# 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'

Termux (Android)

# 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

From source

git clone https://github.com/SmileLulz/gitlulz
cd gitlulz
./build.sh go
# The binary lands at ./gitlulz

Commands

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

Backup Workflow

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.

What a backup contains

  • All refs (refs/heads/*, refs/tags/*, refs/remotes/*) plus every object reachable from them, via git bundle create ... --all HEAD.
  • HEAD is 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.

Configuration

backup reads an optional YAML config file from:

  • $XDG_CONFIG_HOME/gitlulz/config.yaml (when XDG_CONFIG_HOME is 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.

Upgrading from gitlulz-local

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.

Testing

./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.

Building

./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).

License

GPL-3.0-only

About

A simple utility CLI for hosting local Git remotes and backing them up safely.

Topics

gitgit-localgitlulzgitlulz-localgogolanglocal-git

Resources

Readme
GPL-3.0 license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.