git-lfs/README.md

95 lines
3.0 KiB
Markdown
Raw Normal View History

2015-04-09 22:45:18 +00:00
# Git Large File Storage [![Build Status](https://travis-ci.org/github/git-lfs.svg?branch=master)](https://travis-ci.org/github/git-lfs)
2013-09-22 22:00:52 +00:00
2015-04-02 21:13:27 +00:00
Git LFS is a command line extension and [specification](docs/spec.md) for
managing large files with Git. The client is written in Go, with pre-compiled
binaries available for Mac, Windows, Linux, and FreeBSD. Check out the
[Git LFS website][page] for a high level overview of features.
See [CONTRIBUTING.md](CONTRIBUTING.md) for info on working on Git LFS and
2015-08-04 14:32:26 +00:00
sending patches. Related projects are listed on the [Implementations wiki
page][impl]. You can chat with the team at: https://gitter.im/github/git-lfs
2015-04-08 16:10:26 +00:00
[page]: https://git-lfs.github.com/
2015-08-04 14:32:26 +00:00
[impl]: https://github.com/github/git-lfs/wiki/Implementations
2015-04-08 16:10:26 +00:00
## Getting Started
You can install Git LFS several different ways, depending on your setup and
preferences.
* Linux users can install Debian or RPM packages from [PackageCloud](https://packagecloud.io/github/git-lfs).
* Mac users can install from [Homebrew](https://github.com/Homebrew/homebrew) with `brew install git-lfs`.
* [Binary packages are available][rel] for Windows, Mac, Linux, and FreeBSD.
2015-10-21 15:38:21 +00:00
* You can build it with Go 1.5+. See the [Contributing Guide](./CONTRIBUTING.md) for instructions.
Once installed, you can run `git lfs init` to setup the global Git hooks
necessary for Git LFS to work. You can get help on specific commands directly:
```bash
$ git lfs help <subcommand>
```
The [official documentation](docs) has command references and specifications for
the tool.
Note: Git LFS requires Git v1.8.2 or higher.
2015-03-19 19:30:55 +00:00
[rel]: https://github.com/github/git-lfs/releases
### Configuration
2015-03-19 19:30:55 +00:00
Git LFS uses `.gitattributes` files to configure which are managed by Git LFS.
2015-02-07 16:52:50 +00:00
Here is a sample one that saves zips and mp3s:
$ cat .gitattributes
2015-07-09 16:01:50 +00:00
*.mp3 filter=lfs -text
*.zip filter=lfs -text
2015-04-02 21:13:27 +00:00
Git LFS can manage `.gitattributes` for you:
2015-04-02 21:13:27 +00:00
$ git lfs track "*.mp3"
Tracking *.mp3
2015-04-02 21:13:27 +00:00
$ git lfs track "*.zip"
Tracking *.zip
2015-04-02 21:13:27 +00:00
$ git lfs track
Listing tracked paths
*.mp3 (.gitattributes)
*.zip (.gitattributes)
2015-04-02 21:13:27 +00:00
$ git lfs untrack "*.zip"
Untracking *.zip
2015-04-02 21:13:27 +00:00
$ git lfs track
Listing tracked paths
*.mp3 (.gitattributes)
### Pushing commits
2015-04-08 17:31:08 +00:00
Once setup, you're ready to push some commits:
$ git add my.zip
$ git commit -m "add zip"
2015-03-19 19:30:55 +00:00
You can confirm that Git LFS is managing your zip file:
2015-03-19 19:30:55 +00:00
$ git lfs ls-files
my.zip
2015-04-08 17:31:08 +00:00
Once you've made your commits, push your files to the Git remote:
$ git push origin master
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)
2015-03-19 19:30:55 +00:00
To https://github.com/github/git-lfs-test
67fcf6a..47b2002 master -> master
2013-09-22 22:00:52 +00:00
2015-04-02 21:13:27 +00:00
See the [Git LFS overview](https://github.com/github/git-lfs/tree/master/docs)
and [man pages](https://github.com/github/git-lfs/tree/master/docs/man).