Coder Social home page Coder Social logo

git-media's Introduction

git-media

GitMedia extension allows you to use Git with large media files without storing the media in Git itself.

Configuration

Setup the attributes filter settings.

(once after install) $ git config filter.media.clean “git-media filter-clean” $ git config filter.media.smudge “git-media filter-smudge”

Setup the .gitattributes file to map extensions to the filter.

(in repo - once) $ echo “*.mov filter=media -crlf” > .gitattributes

Staging files with those extensions will automatically copy them to the media buffer area (.git/media) until you run ‘git media sync’ wherein they are uploaded. Checkouts that reference media you don’t have yet will try to be automatically downloaded, otherwise they are downloaded when you sync.

Next you need to configure git to tell it where you want to store the large files. There are four options:

  1. Storing remotely in Amazon’s S3

  2. Storing locally in a filesystem path

  3. Storing remotely via SCP (should work with any SSH server)

  4. Storing remotely in atmos

Here are the relevant sections that should go either in ~/.gitconfig (for global settings) or in clone/.git/config (for per-repo settings).

[git-media] transport = <scp|local|s3|atmos> # settings for scp transport scpuser=<user> scphost=<host> scppath=<path_on_remote_server>

# settings for local transport path=<local_filesystem_path>

# settings for s3 transport s3bucket=<name_of_bucket> s3key=<s3 access key> s3secret=<s3 secret key>

# settings for atmos transport endpoint=<atmos server> uid=<atmos_uid> secret=<atmos secret key> tag=<atmos object tag>

Usage

(in repo - repeatedly) $ (hack, stage, commit) $ git media sync

You can also check the status of your media files via

$ git media status

Which will show you files that are waiting to be uploaded and how much data that is. If you want to upload & delete the local cache of media files, run:

$ git media clear

Config Settings

$ git config –global media.auto-download false

Installing

$ sudo gem install trollop
$ sudo gem install s3
$ sudo gem install ruby-atmos-pure
$ sudo gem install right_aws
$ gem build git-media.gemspec
$ sudo gem install git-media-0.1.1.gem

Notes for Windows

It is important to switch off git smart newline character support for media files. Use “-crlf” switch in .gitattributes (for example “*.mov filter=media -crlf”) or config option “core.autocrlf = false”.

If installing on windows, you might run into a problem verifying certificates for S3 or something. If that happens, modify C:Ruby191librubygems1.9.1gemsright_http_connection-1.2.4libright_http_connection.rb And add at line 310, right before “@http.start”:

@http.verify_mode     = OpenSSL::SSL::VERIFY_NONE

Copyright © 2009 Scott Chacon. See LICENSE for details.

git-media's People

Contributors

schacon avatar gigq avatar zapadinsky avatar

Watchers

JT5D avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.