git-lfs/docs/README.md

131 lines
3.5 KiB
Markdown
Raw Normal View History

2015-01-30 17:10:01 +00:00
# Hawser
2014-06-02 14:03:37 +00:00
2015-01-30 17:10:01 +00:00
Hawser is a system for handling large blobs in Git repositories. Instead of
2014-06-02 14:03:37 +00:00
saving the full content of a blob to Git, a pointer file with an ID is written.
2015-01-30 17:10:01 +00:00
A Hawser client can use the ID in the pointer file to download the actual
file from a Hawser server.
2014-06-02 14:03:37 +00:00
* The Client
* [Specification](spec.md)
2015-01-12 11:14:51 +00:00
* [Commands](man)
2014-06-02 14:03:37 +00:00
* The Server
* [API](api.md)
## Getting Started
2015-02-03 17:49:17 +00:00
Download the [latest client](https://github.com/hawser/git-hawser/releases) and run the
included `install.sh` script.
2014-06-02 14:03:37 +00:00
### Configure Git
2015-01-30 17:10:01 +00:00
Run `git hawser init` to set up global Git configuration settings for Hawser.
2014-06-02 14:03:37 +00:00
2014-06-24 21:19:25 +00:00
# automatically run by the install script.
2015-01-30 17:10:01 +00:00
$ git hawser init
git hawser initialized
2014-06-02 14:03:37 +00:00
Git repositories use `.gitattributes` files to configure which files are inserted into
2015-01-30 17:10:01 +00:00
the Hawser server. Here's a sample one that saves zips and mp3s:
2014-06-02 14:03:37 +00:00
$ cat .gitattributes
2015-01-30 19:42:17 +00:00
*.mp3 filter=hawser -crlf
*.zip filter=hawser -crlf
2014-06-02 14:03:37 +00:00
2015-01-30 17:10:01 +00:00
Hawser can help you manage your `.gitattributes` paths:
2014-06-02 14:03:37 +00:00
2015-01-30 17:10:01 +00:00
$ git hawser path add "*.mp3"
2014-06-02 14:03:37 +00:00
Adding path *.mp3
2015-01-30 17:10:01 +00:00
$ git hawser path add "*.zip"
2014-06-02 14:03:37 +00:00
Adding path *.zip
2015-01-30 17:10:01 +00:00
$ git hawser path
2014-06-02 14:03:37 +00:00
Listing paths
*.mp3 (.gitattributes)
*.zip (.gitattributes)
2015-01-30 17:10:01 +00:00
$ git hawser path remove "*.zip"
2014-06-02 14:03:37 +00:00
Removing path *.zip
2015-01-30 17:10:01 +00:00
$ git hawser path
2014-06-02 14:03:37 +00:00
Listing paths
*.mp3 (.gitattributes)
### Push a new commit
Once everything is setup, you can clone or create a new repository that uses
2015-01-30 17:10:01 +00:00
Hawser.
2014-06-02 14:03:37 +00:00
```
$ 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.
```
2015-01-30 17:10:01 +00:00
There will be a pause after the objects have been unpacked, while Hawser
2014-06-02 14:03:37 +00:00
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 ..
drwxr-xr-x 8 rick staff 442 Oct 31 13:40 .git
-rw-r--r-- 1 rick staff 50 Oct 31 13:40 .gitattributes
-rw-r--r-- 1 rick staff 4 Oct 31 13:40 .gitignore
-rw-r--r-- 1 rick staff 12585968 Oct 31 13:40 mac.zip
```
Now, add a file:
```
$ git add my.zip
```
2015-01-30 17:10:01 +00:00
When you can see files being added to hawser, you can commit like
2015-01-12 19:47:32 +00:00
normal. After committing, `git show` will show the file's metadata:
2014-06-02 14:03:37 +00:00
$ git show
commit 47b2002173ae56f6a30c67ec46858a932e8f7511
Author: rick <technoweenie@gmail.com>
Date: Thu Oct 31 12:05:32 2013 -0600
add zip
diff --git a/my.zip b/my.zip
new file mode 100644
index 0000000..fc1f642
--- /dev/null
+++ b/my.zip
@@ -0,0 +1,2 @@
+# git-media
+84ff327f80500d3266bd830891ede1e4fd18b9169936a066573f9b230597a696
\ No newline at end of file
2015-02-03 23:21:50 +00:00
You can also run `git hawser ls-files` to confirm that the file was added with Hawser.
```
# confirm the zip was added to hawser
$ git hawser ls-files
my.zip
```
2014-09-23 14:49:33 +00:00
Now, when you run `git push`, added media files will be synced to the
2015-01-30 17:10:01 +00:00
Hawser endpoint.
2014-06-02 14:03:37 +00:00
$ git push origin master
2014-06-02 14:03:37 +00:00
Sending my.zip
12.58 MB / 12.58 MB 100.00 %
Counting objects: 2, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 548 bytes | 0 bytes/s, done.
Total 5 (delta 1), reused 0 (delta 0)
To https://github.com/github/gitmediatest
67fcf6a..47b2002 master -> master