Skip to content

consider git-annex #1

@hjbockholt

Description

@hjbockholt

Hello,
I was asked to assist Javier with getting this container to build.

I noticed some very large files needed.
Github is not really well suited to actually store these files in the repo directly.

Please take a look at this and consider moving these files to an S3 bucket. We've already done so for some website stuff.

git-annex is a tool that helps you manage files with git, without checking their contents into git. It's very useful for handling large files. The files are stored separately and can be retrieved on demand, allowing you to keep your Git repository small and fast. Here are the general steps to use git-annex:

Installation

First, you'll need to install git-annex. You can find installation instructions specific to your operating system on the git-annex website.

For Ubuntu, you can install it via apt:

sudo apt-get install git-annex

For macOS, you can install it via Homebrew:

brew install git-annex

Initialize git-annex in Your Repository

Navigate to your Git repository in the terminal and run:

git annex init

Add Large Files to git-annex

Instead of git add <filename>, you would use:

git annex add <filename>

This will add the large file to git-annex instead of Git, but it will still track it. Now, instead of the actual file, a symlink pointing to the file will be stored in Git.

Commit and Push

After adding the large files, you would commit and push as normal:

git commit -m "Add large files via git-annex"
git push origin master

Getting Files

To get the content of the files on a different machine or after a fresh clone, you would use:

git annex get <filename>

Sharing Large Files

You can use git-annex to copy your files to various backends like Amazon S3, web servers, or other remote locations. You can specify these with git annex initremote and then use git annex copy to move files to and from these locations.

For example, to copy a file to a remote named "myS3":

git annex copy --to myS3 <filename>

Other Useful Commands

  • To see the status of your files (which files are available, etc.), you can run:

    git annex list
  • To drop a file you no longer need locally (it should be uploaded to another location before doing this):

    git annex drop <filename>
  • To move a file to a remote:

    git annex move --to <remote-name> <filename>

Synchronize All Changes

To synchronize all changes, including getting and dropping contents, you can use:

git annex sync

Note

Before using any advanced features of git-annex, it is strongly recommended to read the documentation and understand what each command does, as improper use can result in loss of data.

By integrating git-annex into your workflow, you can manage large files effectively without bloating your Git repository.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions