Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryobank

Push private Git repositories to your own machine, browse them, and freeze the projects you no longer want on your Mac.

Cryobank has three executables:

  • cryobank runs the SSH endpoint and web browser.
  • git-freeze makes git freeze work.
  • git-thaw makes git thaw work.

There are no users, pull requests, issues, actions, or database. Bare Git repositories hold everything.

Caution

git freeze ends by moving your checkout to the macOS Trash. Cryobank verifies the upload first, but start with a project you can afford to lose.

Install

Install Go and Git, then build the three executables:

$ make test
$ sudo make install

Set PREFIX if /usr/local is not on your PATH:

$ make install PREFIX="$HOME/.local"

Install Cryobank on your Mac and the SSH host.

Set up the host

Choose the directory that will hold the bare repositories:

$ cryobank init /Volumes/Tundra/Cryobank
Cryobank root configured at /Volumes/Tundra/Cryobank

Use a dedicated SSH key. Add it to ~/.ssh/authorized_keys on the host with a forced command:

command="/usr/local/bin/cryobank shell",restrict ssh-ed25519 AAAA... cryobank

Add an SSH alias on your Mac:

Host cryobank
    HostName pangolin.local
    IdentityFile ~/.ssh/id_ed25519_cryobank

Tell the Git commands which host to use:

$ git config --global cryobank.host cryobank

Push and pull

The forced SSH command resolves repository names inside the configured root. The first push creates the bare repository.

$ git remote add cryobank cryobank:weekend-compiler.git
$ git push -u cryobank main
$ git clone cryobank:weekend-compiler.git

Freeze and thaw

Freeze the current checkout:

$ git freeze
Froze /Users/me/Code/weekend-compiler to cryobank as weekend-compiler and moved it to Trash.

Before touching the checkout, Cryobank:

  1. Captures all refs, stashes, staged changes, unstaged changes, and untracked files that Git does not ignore.
  2. Uploads a resumable Git bundle over SSH.
  3. Verifies its checksum and every ref on the host.
  4. Checks that the checkout did not change during the upload.
  5. Calls the macOS /usr/bin/trash command.

Cryobank does not upload ignored files. They often contain builds, dependencies, caches, or secrets. git freeze moves them to Trash with the checkout, and git thaw cannot restore them.

Bring a project back with:

$ git thaw weekend-compiler

Thaw restores the branch, file contents, untracked files, and stash refs. Staged and unstaged changes return as unstaged changes. Pass a second argument to choose the checkout path:

$ git thaw weekend-compiler ~/Code/compiler

Browse

Start the read-only web UI on the host:

$ cryobank serve
Serving /Volumes/Tundra/Cryobank on http://127.0.0.1:9418

Forward it to your Mac:

$ ssh -N -L 9418:127.0.0.1:9418 pangolin.local

Open http://127.0.0.1:9418. The project feed marks repositories as active, frozen, or deep archive. A frozen project becomes deep archive after 180 days. Repository pages show branches, recent commits, trees, and files.

Warning

The web UI has no authentication. Keep it on localhost and use an SSH tunnel, VPN, or trusted reverse proxy.

Storage

The configured root contains ordinary bare repositories:

Cryobank/
├── weekend-compiler.git/
├── old-homebrew.git/
└── .uploads/

Back up that whole directory. The .uploads directory contains resumable transfers and can be discarded when no freeze is running.

About

Archive Git repositories over SSH, browse them on the web, then safely Trash the local checkout

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages