update
This commit is contained in:
parent
23f95ac6df
commit
946a7f3f21
1 changed files with 26 additions and 33 deletions
|
@ -1,15 +1,15 @@
|
||||||
git-annex allows managing files with git, without checking the file
|
git-annex allows managing files with git, without checking the file
|
||||||
contents into git. This is useful when dealing with files larger than git
|
contents into git. While that may seem paradoxical, it is useful when
|
||||||
can currently easily handle, whether due to limitations in memory,
|
dealing with files larger than git can currently easily handle, whether due
|
||||||
checksumming time, or disk space (only one copy need be stored of an
|
to limitations in memory, checksumming time, or disk space.
|
||||||
annexed file).
|
|
||||||
|
|
||||||
Even without file content tracking, being able to manage file metadata with
|
Even without file content tracking, being able to manage files with git,
|
||||||
git, move files around and delete files with versioned directory trees, and use
|
move files around and delete files with versioned directory trees, and use
|
||||||
branches and distributed clone, are all very handy reasons to use git. And
|
branches and distributed clones, are all very handy reasons to use git. And
|
||||||
annexed files can co-exist in the same git repository with regularly versioned
|
annexed files can co-exist in the same git repository with regularly
|
||||||
files, which is convenient for maintaining code, Makefiles, etc that are
|
versioned files, which is convenient for maintaining documents, Makefiles,
|
||||||
associated with annexed files but that benefit from full revision control.
|
etc that are associated with annexed files but that benefit from full
|
||||||
|
revision control.
|
||||||
|
|
||||||
Enough broad picture, here's how it actually looks:
|
Enough broad picture, here's how it actually looks:
|
||||||
|
|
||||||
|
@ -17,13 +17,13 @@ Enough broad picture, here's how it actually looks:
|
||||||
it with a symlink pointing at the annexed file, and then calls `git add`
|
it with a symlink pointing at the annexed file, and then calls `git add`
|
||||||
to version the *symlink*. (If the file has already been annexed, it does
|
to version the *symlink*. (If the file has already been annexed, it does
|
||||||
nothing.)
|
nothing.)
|
||||||
|
* If you use normal git push/pull commands, the annexed file content
|
||||||
|
won't be transferred, but the symlinks will be. So different clones of a
|
||||||
|
repository can have different sets of annexed files available.
|
||||||
* You can move the symlink around, copy it, delete it, etc, and commit changes
|
* You can move the symlink around, copy it, delete it, etc, and commit changes
|
||||||
as desired using git. Reading the symlink will always get you the annexed
|
as desired using git. Reading the symlink will always get you the annexed
|
||||||
file content, or the link may be broken if the content is not currently
|
file content, or the link may be broken if the content is not currently
|
||||||
available.
|
available.
|
||||||
* If you use normal git push/pull commands, the annexed file contents
|
|
||||||
won't be sent, but the symlinks will be. So different clones of a repository
|
|
||||||
can have different sets of annexed files available.
|
|
||||||
* `git annex push $repository` pushes *all* annexed files to the specified
|
* `git annex push $repository` pushes *all* annexed files to the specified
|
||||||
repository.
|
repository.
|
||||||
* `git annex pull $repository` pulls *all* annexed files from the specified
|
* `git annex pull $repository` pulls *all* annexed files from the specified
|
||||||
|
@ -31,9 +31,9 @@ Enough broad picture, here's how it actually looks:
|
||||||
* `git annex want $file` indicates that you want access to a file's
|
* `git annex want $file` indicates that you want access to a file's
|
||||||
content, without immediatly transferring it.
|
content, without immediatly transferring it.
|
||||||
* `git annex get $file` is used to transfer a specified file, and/or
|
* `git annex get $file` is used to transfer a specified file, and/or
|
||||||
files previously indicated with `git annex want`. If a configured repository has it,
|
files previously indicated with `git annex want`. If a configured
|
||||||
or it is available from other key/value storage, it will be immediatly
|
repository has it, or it is available from other key/value storage,
|
||||||
downloaded.
|
it will be immediatly downloaded.
|
||||||
* `git annex drop $file` indicates that you no longer want the file's
|
* `git annex drop $file` indicates that you no longer want the file's
|
||||||
content to be available in this repository.
|
content to be available in this repository.
|
||||||
* `git annex unannex $file` undoes a `git annex add`. But use `git annex drop`
|
* `git annex unannex $file` undoes a `git annex add`. But use `git annex drop`
|
||||||
|
@ -48,17 +48,16 @@ git-annex can be configured to try to keep N copies of a file's content
|
||||||
available across all repositories. By default, N is 1 (configured by
|
available across all repositories. By default, N is 1 (configured by
|
||||||
annex.numcopies).
|
annex.numcopies).
|
||||||
|
|
||||||
`git annex drop` attempts to check all other configured
|
`git annex drop` attempts to check with other git remotes, to check that N
|
||||||
repositories, to check that N copies of the file exist. If enough
|
copies of the file exist. If enough repositories cannot be verified to have
|
||||||
repositories cannot be verified to have it, it will retain the file content
|
it, it will retain the file content to avoid data loss.
|
||||||
to avoid data loss.
|
|
||||||
|
|
||||||
For example, consider three repositories: Server, Laptop, and USB. Both Server
|
For example, consider three repositories: Server, Laptop, and USB. Both Server
|
||||||
and USB have a copy of a file, and N=1. If on Laptop, you `git annex get
|
and USB have a copy of a file, and N=1. If on Laptop, you `git annex get
|
||||||
$file`, this will transfer it from either Server or USB (depending on which
|
$file`, this will transfer it from either Server or USB (depending on which
|
||||||
is available), and there are now 3 copies of the file.
|
is available), and there are now 3 copies of the file.
|
||||||
|
|
||||||
Suppose you want to free up space on laptop again, and you `git annex drop` the file
|
Suppose you want to free up space on Laptop again, and you `git annex drop` the file
|
||||||
there. If USB is connected, or Server can be contacted, git-annex can check
|
there. If USB is connected, or Server can be contacted, git-annex can check
|
||||||
that it still has a copy of the file, and the content is removed from
|
that it still has a copy of the file, and the content is removed from
|
||||||
Laptop. But if USB is currently disconnected, and Server also cannot be
|
Laptop. But if USB is currently disconnected, and Server also cannot be
|
||||||
|
@ -70,17 +69,11 @@ to both USB and Server.
|
||||||
|
|
||||||
Note that different repositories can be configured with different values of
|
Note that different repositories can be configured with different values of
|
||||||
N. So just because Laptop has N=2, this does not prevent the number of
|
N. So just because Laptop has N=2, this does not prevent the number of
|
||||||
copies falling to 1, when USB and Server have N=1, and if they have the
|
copies falling to 1, when USB and Server have N=1.
|
||||||
only copies of a file.
|
|
||||||
|
|
||||||
## the .git-annex directory
|
|
||||||
|
|
||||||
The `.git-annex` directory at the top of the repository is used to store
|
|
||||||
git-annex information that should be propigated between repositories.
|
|
||||||
|
|
||||||
## key/value storage
|
## key/value storage
|
||||||
|
|
||||||
git-annex uses a key/value abstraction layer to allow files contents to be
|
git-annex uses a key/value abstraction layer to allow file contents to be
|
||||||
stored in different ways. In theory, any key/value storage system could be
|
stored in different ways. In theory, any key/value storage system could be
|
||||||
used to store the file contents, and git-annex would then retrieve them
|
used to store the file contents, and git-annex would then retrieve them
|
||||||
as needed and put them in `.git/annex/`.
|
as needed and put them in `.git/annex/`.
|
||||||
|
@ -94,15 +87,15 @@ Multiple pluggable backends are supported, and more than one can be used
|
||||||
to store different files' contents in a given repository.
|
to store different files' contents in a given repository.
|
||||||
|
|
||||||
* `WORM` ("Write Once, Read Many") This backend stores the file's content
|
* `WORM` ("Write Once, Read Many") This backend stores the file's content
|
||||||
in `.git/annex/`, and assumes that any file with the same basename,
|
only in `.git/annex/`, and assumes that any file with the same basename,
|
||||||
size, and modification time has the same content. So with this backend,
|
size, and modification time has the same content. So with this backend,
|
||||||
files can be moved around, but should never be added to or changed.
|
files can be moved around, but should never be added to or changed.
|
||||||
This is the default, and the least expensive backend.
|
This is the default, and the least expensive backend.
|
||||||
* `sha1sum` -- This backend stores the file's content in
|
* `SHA1` -- This backend stores the file's content in
|
||||||
`.git/annex/`, with a name based on its sha1 checksum. This backend allows
|
`.git/annex/`, with a name based on its sha1 checksum. This backend allows
|
||||||
modifications of files to be tracked. Its need to generate checksums
|
modifications of files to be tracked. Its need to generate checksums
|
||||||
can make it slow for large files.
|
can make it slow for large files.
|
||||||
* `url` -- This backend downloads the file's content from an external URL.
|
* `URL` -- This backend downloads the file's content from an external URL.
|
||||||
|
|
||||||
## location tracking
|
## location tracking
|
||||||
|
|
||||||
|
@ -132,7 +125,7 @@ example:
|
||||||
* `annex.numcopies` -- number of copies of files to keep (default: 1)
|
* `annex.numcopies` -- number of copies of files to keep (default: 1)
|
||||||
* `annex.backends` -- space-separated list of names of
|
* `annex.backends` -- space-separated list of names of
|
||||||
the key/value backends to use. The first listed is used to store
|
the key/value backends to use. The first listed is used to store
|
||||||
new files. (default: file, checksum, url)
|
new files. (default: "WORM SHA1 URL")
|
||||||
* `remote.<name>.annex-cost` -- When determining which repository to
|
* `remote.<name>.annex-cost` -- When determining which repository to
|
||||||
transfer annexed files from or to, ones with lower costs are preferred.
|
transfer annexed files from or to, ones with lower costs are preferred.
|
||||||
The default cost is 100 for local repositories, and 200 for remote
|
The default cost is 100 for local repositories, and 200 for remote
|
||||||
|
|
Loading…
Reference in a new issue