<commit_before># Git Media

Git Media is a system for handling large blobs in Git repositories.  Instead of
saving the full content of a blob to Git, a pointer file with an ID is written.
A Git Media client can use the ID in the pointer file to download the actual
file from a Git Media server.

* The Client
  * [Specification](spec.md)
  * [Commands](../man)
* The Server
  * [API](api.md)

## Getting Started

The client lives in [github/git-media](https://github.com/github/git-media).

Download the [latest release](https://github.com/github/git-media/releases/tag/v0.1.0).  Below
are the linked Git Media binaries for Mac and Windows:

* [Mac](https://github.com/github/git-media/releases/download/v0.1.0/git-media-darwin-amd64-0.1.0.tar.gz)
* [Windows](https://github.com/github/git-media/releases/download/v0.1.0/git-media-windows-amd64-0.1.0.zip) (amd64)

### Configure Git

Run `git media init` to set up global Git configuration settings for Git Media.

    # automatically run by the install script.
    $ git media init
    git media initialized

Git repositories use `.gitattributes` files to configure which files are inserted into
the Git Media server.  Here's a sample one that saves zips and mp3s:

    $ cat .gitattributes
    *.mp3 filter=media -crlf
    *.zip filter=media -crlf

Git media can help you manage your `.gitattributes` paths:

    $ git media paths add "*.mp3"
    Adding path *.mp3

    $ git media paths add "*.zip"
    Adding path *.zip

    $ git media paths
    Listing paths
        *.mp3 (.gitattributes)
        *.zip (.gitattributes)

    $ git media paths remove "*.zip"
    Removing path *.zip

    $ git media paths
    Listing paths
        *.mp3 (.gitattributes)

### Push a new commit

Once everything is setup, you can clone or create a new repository that uses
Git Media.

```
$ git clone https://github.com/github/gitmediatest
Cloning into 'gitmediatest'...
remote: Counting objects: 22, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 22 (delta 2), reused 22 (delta 2)
Unpacking objects: 100% (22/22), done.
```

There will be a pause after the objects have been unpacked, while Git Media
downloads the files.  You can tell it worked if the file contains the actual
content, and not a tiny external pointer file:

```
$ cd gitmediatest
$ ls -al
total 24600
drwxr-xr-x   3 rick  staff       204 Oct 31 13:40 .
drwxr-xr-x  70 rick  staff      2414 Oct 31 13:40 ..<commit_msg>Kill the s :fire:<commit_after># Git Media

Git Media is a system for handling large blobs in Git repositories.  Instead of
saving the full content of a blob to Git, a pointer file with an ID is written.
A Git Media client can use the ID in the pointer file to download the actual
file from a Git Media server.

* The Client
  * [Specification](spec.md)
  * [Commands](../man)
* The Server
  * [API](api.md)

## Getting Started

The client lives in [github/git-media](https://github.com/github/git-media).

Download the [latest release](https://github.com/github/git-media/releases/tag/v0.1.0).  Below
are the linked Git Media binaries for Mac and Windows:

* [Mac](https://github.com/github/git-media/releases/download/v0.1.0/git-media-darwin-amd64-0.1.0.tar.gz)
* [Windows](https://github.com/github/git-media/releases/download/v0.1.0/git-media-windows-amd64-0.1.0.zip) (amd64)

### Configure Git

Run `git media init` to set up global Git configuration settings for Git Media.

    # automatically run by the install script.
    $ git media init
    git media initialized

Git repositories use `.gitattributes` files to configure which files are inserted into
the Git Media server.  Here's a sample one that saves zips and mp3s:

    $ cat .gitattributes
    *.mp3 filter=media -crlf
    *.zip filter=media -crlf

Git media can help you manage your `.gitattributes` paths:

    $ git media path add "*.mp3"
    Adding path *.mp3

    $ git media path add "*.zip"
    Adding path *.zip

    $ git media path
    Listing paths
        *.mp3 (.gitattributes)
        *.zip (.gitattributes)

    $ git media path remove "*.zip"
    Removing path *.zip

    $ git media path
    Listing paths
        *.mp3 (.gitattributes)

### Push a new commit

Once everything is setup, you can clone or create a new repository that uses
Git Media.

```
$ git clone https://github.com/github/gitmediatest
Cloning into 'gitmediatest'...
remote: Counting objects: 22, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 22 (delta 2), reused 22 (delta 2)
Unpacking objects: 100% (22/22), done.
```

There will be a pause after the objects have been unpacked, while Git Media
downloads the files.  You can tell it worked if the file contains the actual
content, and not a tiny external pointer file:

```
$ cd gitmediatest
$ ls -al
total 24600
drwxr-xr-x   3 rick  staff       204 Oct 31 13:40 .
drwxr-xr-x  70 rick  staff      2414 Oct 31 13:40 ..
{'fraction_non_alphanumeric': 0.10300429184549356, 'fraction_numerical': 0.031064786429593295, 'mean_word_length': 3.1972555746140654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2303374', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1507, 'n_words': 617}