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