Git off is system for handling large/binary files in git repositories.

It has multiple transport types such as copy, scp server, http and amazon s3.

It aims at handling large files transparently, the normal git workflow is kept.

git off track '*.bin'
git add .
git commit
git push

New git repo setup

When a new git repo is created, configure the git-off transport and track some files with git-off.

git off track '*.bin'
git add .
git commit

Then copy the files to the store, here transport is set to copy

git off copyTo copy

Now the files tracked by git-off are stored in the store and are available for the clones of the repo.

Multiple configurations

I use multiple configuration when I share git repos with the public. I want the public to have read-only access to the binaries in the repo.

In the repo, I setup git off to download from an http server. In my development environment I setup a configuration using $GIT_OFF_CONFIG.

.git-off in repo:

[off]
  mode = http
  http = http://localhost/offStore

Development configuration:

vi ~/.git-off.cfg
[off]
  mode = scp
  scphost = localhost:/var/www/offStore

export GIT_OFF_CONFIG=~/.git-off.cfg

To show the current git off configuration, I run:

git off env

Integrity

To make sure the binaries are not changed in the store, I setup the integrity check:

git off integrity enable

This option slows down the system because the files are hashed before they are copied to the working directory.

Transform

Files can be processed by an arbitrary command when uploaded/downloaded from the store.

I use transform to compress or encrypt files in the store.

First enable transform:

git off transform enable

I use pbzip2 to parallel compress the files:

git off transformTo 'pbzip2 -9 -c _1 > _2'
git off transformFrom 'pbzip2 -d -c _1 > _2'

To encrypt files in the store, I use gpg:

git off transformTo 'gpg -c -z 9 --passphrase __LONG_RANDOM_PASSPHRASE__ --cipher-algo AES256 --yes -o _2 _1'
git off transformFrom 'gpg --passphrase __LONG_RANDOM_PASSPHRASE__ --yes -o _2 _1'