Encode and decode files into seemingly empty repos using git tags
It utilizes the fact that git tags can store messages, and they only need a commit to attach to, and the fact that git allows creation of empty commits makes it more seamless. The file is compressed and base64 encoded, then split into chunks that fit within the git tag message size limit. Each chunk is stored as a separate git tag attached to the initial empty commit.
The decode script retrieves the tags, reconstructs the original file by decoding and decompressing the data. and saves it to disk.
The repo contains two scripts: encode.py and decode.py.
To encode a file into git tags, run:
uv run encode.py <path/to/file>or
python encode.py <path/to/file>To decode the file from git tags, cd into the repo and run:
uv run decode.pyor
python decode.py