1git-annex-export(1)         General Commands Manual        git-annex-export(1)
2
3
4

NAME

6       git-annex-export - export a tree of files to a special remote
7

SYNOPSIS

9       git annex export treeish --to remote
10

DESCRIPTION

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       When the  remote  has  a  preferred  content  expression  set  by  git-
28       annex-wanted(1),  the treeish is filtered through it, excluding annexed
29       files it does not want from being exported to it. (Note that things  in
30       the expression like "include=" match relative to the top of the treeish
31       being exported.)
32
33       Any files in the treeish that are stored on git will also  be  exported
34       to the special remote.
35
36       Repeated exports are done efficiently, by diffing the old and new tree,
37       and transferring only the changed files, and renaming files  as  neces‐
38       sary.
39
40       Exports  can  be  interrupted  and resumed. However, partially uploaded
41       files will be re-started from the beginning in most cases.
42
43       Once content has been exported to a remote, commands like git annex get
44       can  download  content  from there the same as from other remotes. How‐
45       ever, since an export is not a key/value store,  git-annex  has  to  do
46       more  verification  of content downloaded from an export. Some types of
47       keys, that are not based on checksums, cannot  be  downloaded  from  an
48       export.   And,  git-annex will never trust an export to retain the con‐
49       tent of a key.
50
51       However, some special remotes, notably S3, support keeping track of old
52       versions  of  files stored in them. If a special remote is set up to do
53       that, it can be used as a key/value store and the  limitations  in  the
54       above  paragraph  do  not apply. Note that dropping content from such a
55       remote is not supported. See individual special remotes'  documentation
56       for details of how to enable such versioning.
57
58       The  git annex sync --content command (and the git-annex assistant) can
59       also be used to export a branch to a special remote, updating the  spe‐
60       cial  remote  whenever  the branch is changed.  To do this, you need to
61       configure "remote.<name>.annex-tracking-branch" to tell it what  branch
62       to track.  For example:
63
64        git config remote.myremote.annex-tracking-branch master
65        git annex sync --content
66
67       You  can  combine  using  git annex export to send changes to a special
68       remote with git annex import to fetch changes from  a  special  remote.
69       When  a  file  on  a special remote has been modified by software other
70       than git-annex, exporting to it will not overwrite the  modified  file,
71       and the export will not succeed. You can resolve this conflict by using
72       git annex import.
73
74       (Some types of special remotes such as S3 with versioning  may  instead
75       let  an  export overwrite the modified file; then git annex import will
76       create a sequence of commits that includes the modified  file,  so  the
77       overwritten modification is not lost.)
78

OPTIONS

80       --to=remote
81
82              Specify the special remote to export to.
83
84       --tracking
85              This  is  a  deprecated  way  to set "remote.<name>.annex-track‐
86              ing-branch".  Instead of using this option, you should just  set
87              the git configuration yourself.
88
89       --fast This  sets up an export of a tree, but avoids any expensive file
90              uploads to the remote. You can later run git annex  sync  --con‐
91              tent to upload the files to the export.
92
93       --jobs=N -JN
94              Exports  multiple  files  in  parallel. This may be faster.  For
95              example: -J4
96
97              Setting this to "cpus" will run one job per CPU core.
98
99       --json Enable JSON output. This is intended to be  parsed  by  programs
100              that use git-annex. Each line of output is a JSON object.
101
102       --json-progress
103              Include progress objects in JSON output.
104
105       --json-error-messages
106              Messages  that  would  normally  be output to standard error are
107              included in the json instead.
108

EXAMPLE

110        git annex initremote myremote  type=directory  directory=/mnt/myremote
111           exporttree=yes encryption=none
112        git annex export master --to myremote
113
114       After  that,  /mnt/myremote  will contain the same tree of files as the
115       master branch does.
116
117        git mv myfile subdir/myfile
118        git commit -m renamed
119        git annex export master --to myremote
120
121       That updates /mnt/myremote to reflect the renamed file.
122
123        git annex export master:subdir --to myremote
124
125       That updates /mnt/myremote, to contain only the files in  the  "subdir"
126       directory of the master branch.
127

EXPORT CONFLICTS

129       If  two  different  git-annex repositories are both exporting different
130       trees to the same special remote, it's possible for an export  conflict
131       to  occur.   This  leaves  the  special remote with some files from one
132       tree, and some files from the other. Files in the  special  remote  may
133       have entirely the wrong content as well.
134
135       It's  not  possible  for git-annex to detect when making an export will
136       result in an export conflict. The best way to avoid export conflicts is
137       to  either  only  ever export to a special remote from a single reposi‐
138       tory, or to have a rule about the tree that you export to  the  special
139       remote.  For  example, if you always export origin/master after pushing
140       to origin, then an export conflict can't happen.
141
142       An export conflict can only be detected after the two git  repositories
143       that produced it get back in sync. Then the next time you run git annex
144       export, it will detect the export conflict, and resolve it.
145

SEE ALSO

147       git-annex(1)
148
149       git-annex-initremote(1)
150
151       git-annex-import(1)
152
153       git-annex-sync(1)
154
155       git-annex-preferred-content(1)
156

HISTORY

158       The export command was introduced in git-annex version 6.20170925.
159

AUTHOR

161       Joey Hess <id@joeyh.name>
162
163                                                           git-annex-export(1)
Impressum