2011-08-28 20:28:38 +00:00
|
|
|
Annexed data is stored inside your git repository's `.git/annex` directory.
|
|
|
|
Some [[special_remotes]] can store annexed data elsewhere.
|
2010-10-19 19:59:40 +00:00
|
|
|
|
|
|
|
It's important that data not get lost by an ill-considered `git annex drop`
|
2011-08-28 20:28:38 +00:00
|
|
|
command. So, git-annex can be configured to try
|
2010-11-28 19:28:20 +00:00
|
|
|
to keep N copies of a file's content available across all repositories.
|
2011-01-26 18:09:06 +00:00
|
|
|
(Although [[untrusted_repositories|trust]] don't count toward this total.)
|
2010-11-28 19:28:20 +00:00
|
|
|
|
2014-01-20 20:47:56 +00:00
|
|
|
By default, N is 1; it is configured by running `git annex numcopies N`.
|
|
|
|
This default can be overridden on a per-file-type basis by the annex.numcopies
|
2011-06-01 20:54:28 +00:00
|
|
|
setting in `.gitattributes` files. The --numcopies switch allows
|
|
|
|
temporarily using a different value.
|
2010-10-19 19:59:40 +00:00
|
|
|
|
|
|
|
`git annex drop` attempts to check with other git remotes, to check that N
|
|
|
|
copies of the file exist. If enough repositories cannot be verified to have
|
2010-12-28 21:17:02 +00:00
|
|
|
it, it will retain the file content to avoid data loss. Note that
|
2010-12-29 21:01:56 +00:00
|
|
|
[[trusted_repositories|trust]] are not explicitly checked.
|
2010-10-19 19:59:40 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
$file`, this will transfer it from either Server or USB (depending on which
|
|
|
|
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
|
|
|
|
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
|
|
|
|
Laptop. But if USB is currently disconnected, and Server also cannot be
|
|
|
|
contacted, it can't verify that it is safe to drop the file, and will
|
|
|
|
refuse to do so.
|
|
|
|
|
|
|
|
With N=2, in order to drop the file content from Laptop, it would need access
|
|
|
|
to both USB and Server.
|