Giter VIP home page Giter VIP logo

git-annex-remote-b2's Introduction

Installation

Binaries are available in the releases page. You want to add the binary to your $PATH, either by creating a new directory for it (ideally inside your home directory, such as ~/bin), or by putting the binary in a directory that is already in your $PATH (such as /usr/local/bin.)

To build from source, set up a GOPATH and then run go get github.com/encryptio/git-annex-remote-b2.

Usage

After putting git-annex-remote-b2 in your $PATH, use it like any other external remote:

~/repo $ git annex initremote b2 type=external externaltype=b2 bucket=mydata

B2 credentials may either be given as arguments to initremote ( accountid=XXXX appkey=XXXXXXXXXXXXXXXX) or as the environment variables $B2_APP_KEY and $B2_ACCOUNT_ID. If you pass them as arguments to initremote, the credentials will be stored in the git-annex repository and thus will be available to all clones of it.

Optionally, you may pass prefix=something to have git-annex-remote-b2 prepend something/ to the keys it stores in B2.

Improving the financial cost of this remote

By default, all remotes are semitrusted in git-annex. This means that the remote should be checked to see if it actually has data when doing an operation that assumes that the data is safe if they have it and unsafe if not (for example, a local git annex drop.) If you tell git-annex that this remote won't lose data randomly by setting this remote's trust level higher, then those checkpresentkey calls (which turn into ListFileNames calls on B2) should go away.

This is particularly important if you're under the free trial limits of B2.

~/repo $ git annex trust b2

Secondly, git-annex will assume all non-local remotes have the same cost, and won't prefer one over the other by default. If you have a remote that doesn't cost as much as talking to B2, you should set the B2 remote's cost very high so that git-annex will prefer talking to the cheap remote rather than B2 when possible. (The default values are 100 for local remotes, and 200 for non-local remotes.)

~/repo $ git config remote.b2.annex-cost 1000

Note that setting the annex-cost like this is a repo-local operation only; it does not apply to other clones of the repo you might have.

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.