1git-annex-export(1) General Commands Manual git-annex-export(1)
2
3
4
6 git-annex-export - export content to a remote
7
9 git annex export treeish --to remote
10
11 git annex export --tracking treeish --to remote
12
14 Use this command to export a tree of files from a git-annex repository.
15
16 Normally files are stored on a git-annex special remote named by their
17 keys. That is great for reliable data storage, but your filenames are
18 obscured. Exporting replicates the tree to the special remote as-is.
19
20 Mixing key/value storage and exports in the same remote would be a mess
21 and so is not allowed. You have to configure a special remote with
22 exporttree=yes when initially setting it up with git-annex-ini‐
23 tremote(1).
24
25 The treeish to export can be the name of a git branch, or a tag, or any
26 other treeish accepted by git, including eg master:subdir to only
27 export a subdirectory from a branch.
28
29 Repeated exports are done efficiently, by diffing the old and new tree,
30 and transferring only the changed files, and renaming files as neces‐
31 sary.
32
33 Exports can be interrupted and resumed. However, partially uploaded
34 files will be re-started from the beginning in most cases.
35
36 Once content has been exported to a remote, commands like git annex get
37 can download content from there the same as from other remotes. How‐
38 ever, since an export is not a key/value store, git-annex has to do
39 more verification of content downloaded from an export. Some types of
40 keys, that are not based on checksums, cannot be downloaded from an
41 export. And, git-annex will never trust an export to retain the con‐
42 tent of a key.
43
44 However, some special remotes, notably S3, support keeping track of old
45 versions of files stored in them. If a special remote is set up to do
46 that, it can be used as a key/value store and the limitations in the
47 above paragraph do not appy. Note that dropping content from such a
48 remote is not supported. See individual special remotes' documentation
49 for details of how to enable such versioning.
50
52 --to=remote
53
54 Specify the special remote to export to.
55
56 --tracking
57 This makes the export track changes that are committed to the
58 branch. git annex sync --content and the git-annex assistant
59 will update exports with commits made to the branch.
60
61 This is a local configuration setting, similar to a git remote's
62 tracking branch. You'll need to run git annex export --tracking
63 in each repository you want the export to track.
64
65 --fast This sets up an export of a tree, but avoids any expensive file
66 uploads to the remote. You can later run git annex sync --con‐
67 tent to upload the files to the export.
68
70 git annex initremote myexport type=directory directory=/mnt/myexport
71 exporttree=yes encryption=none
72 git annex export master --to myexport
73
74 After that, /mnt/myexport will contain the same tree of files as the
75 master branch does.
76
77 git mv myfile subdir/myfile
78 git commit -m renamed
79 git annex export master --to myexport
80
81 That updates /mnt/myexport to reflect the renamed file.
82
83 git annex export master:subdir --to myexport
84
85 That updates /mnt/myexport, to contain only the files in the "subdir"
86 directory of the master branch.
87
88 git annex export --tracking master --to myexport
89
90 That makes myexport track changes that are committed to the master
91 branch.
92
94 If two different git-annex repositories are both exporting different
95 trees to the same special remote, it's possible for an export conflict
96 to occur. This leaves the special remote with some files from one
97 tree, and some files from the other. Files in the special remote may
98 have entirely the wrong content as well.
99
100 It's not possible for git-annex to detect when making an export will
101 result in an export conflict. The best way to avoid export conflicts is
102 to either only ever export to a special remote from a single reposi‐
103 tory, or to have a rule about the tree that you export to the special
104 remote. For example, if you always export origin/master after pushing
105 to origin, then an export conflict can't happen.
106
107 An export conflict can only be detected after the two git repositories
108 that produced it get back in sync. Then the next time you run git annex
109 export, it will detect the export conflict, and resolve it.
110
112 git-annex(1)
113
114 git-annex-initremote(1)
115
116 git-annex-sync(1)
117
119 The export command was introduced in git-annex version 6.20170925.
120
122 Joey Hess <id@joeyh.name>
123
124 git-annex-export(1)