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

NAME

6       git-annex-sync - synchronize local repository with remotes
7

SYNOPSIS

9       git annex sync [remote ...]
10

DESCRIPTION

12       This command synchronizes the local repository with its remotes.
13
14       The  sync  process involves first committing any local changes to files
15       that have previously been added to the repository,  then  fetching  and
16       merging  the  current  branch  and the git-annex branch from the remote
17       repositories, and finally pushing the changes back to those branches on
18       the  remote  repositories. You can use standard git commands to do each
19       of those steps by hand, or  if  you  don't  want  to  worry  about  the
20       details, you can use sync.
21
22       The content of annexed objects is not synced by default, but the --con‐
23       tent option (see below) can make that also be synchronized.
24
25       When using git-annex, often remotes are not bare repositories,  because
26       it's helpful to add remotes for nearby machines that you want to access
27       the same annexed content. Syncing with a non-bare remote will not  nor‐
28       mally  update  the  remote's current branch with changes from the local
29       repository. (Unless the remote is configured with  receive.denyCurrent‐
30       Branch=updateInstead.)
31
32       To make working with such non-bare remotes easier, sync pushes not only
33       local master to remote master, but also to  remote  synced/master  (and
34       similar  with  other branches). When git-annex sync is later run on the
35       remote, it will merge the synced/  branches  that  the  repository  has
36       received.
37

OPTIONS

39       [remote]
40
41              By default, all remotes are synced, except for remotes that have
42              remote.<name>.annex-sync set to false. By specifying  the  names
43              of  remotes  (or  remote  groups), you can control which ones to
44              sync with.
45
46       --fast Only sync with the remotes with the lowest annex-cost value con‐
47              figured.
48
49       --only-annex -a, --not-only-annex
50              Only sync the git-annex branch and annexed content with remotes,
51              not other git branches.
52
53              This avoids pulling and pushing other branches,  and  it  avoids
54              committing  any local changes. It's up to you to use regular git
55              commands to do that.
56
57              The annex.synconlyannex configuration can be set to true to make
58              this be the default behavior of git-annex sync. To override such
59              a setting, use --not-only-annex.
60
61              When this is combined  with  --no-content,  only  the  git-annex
62              branch will be synced.
63
64       --commit, --no-commit
65              A  commit  is done by default (unless annex.autocommit is set to
66              false).
67
68              Use --no-commit to avoid committing local changes.
69
70       --message=msg
71              Use this option to specify a commit message.
72
73       --pull, --no-pull
74              By default, syncing pulls from remotes  and  imports  from  some
75              special remotes. Use --no-pull to disable all pulling.
76
77              When  remote.<name>.annex-pull  or  remote.<name>.annex-sync are
78              set to false, pulling is disabled for those remotes,  and  using
79              --pull will not enable it.
80
81       --push, --no-push
82              By  default,  syncing  pushes  changes to remotes and exports to
83              some special remotes. Use --no-push to disable all pushing.
84
85              When remote.<name>.annex-push  or  remote.<name>.annex-sync  are
86              set  to  false,  or remote.<name>.annex-readonly is set to true,
87              pushing is disabled for those remotes, and using --push will not
88              enable it.
89
90       --content, --no-content
91              Normally,  syncing  does  not  transfer  the contents of annexed
92              files.  The --content option causes the content of annexed files
93              to also be uploaded and downloaded as necessary.
94
95              The  annex.synccontent  configuration can be set to true to make
96              content be synced by default.
97
98              Normally this tries to get each  annexed  file  that  the  local
99              repository does not yet have, and then copies each file to every
100              remote that it is syncing with.  This behavior can be overridden
101              by  configuring  the preferred content of a repository. See git-
102              annex-preferred-content(1).
103
104              When remote.<name>.annex-tracking-branch  is  configured  for  a
105              special  remote  and  that  branch  is checked out, syncing will
106              import changes from the remote, merge them into the branch,  and
107              export  any  changes that have been committed to the branch back
108              to  the   remote.   See   See   git-annex-import(1)   and   git-
109              annex-export(1)  for  details  about how importing and exporting
110              work.
111
112       --content-of=path -C path
113              While --content operates  on  all  annexed  files,  --content-of
114              allows  limiting  the transferred files to ones in a given loca‐
115              tion.
116
117              This option can be repeated multiple times with different paths.
118
119       --all -A
120              This option, when combined with --content, makes  all  available
121              versions of all files be synced, when preferred content settings
122              allow.
123
124              Note that  preferred  content  settings  that  use  include=  or
125              exclude=  will  only match the version of files currently in the
126              work tree, but not past versions of files.
127
128       --jobs=N -JN
129              Enables parallel syncing with up to the specified number of jobs
130              running at once. For example: -J10
131
132              Setting this to "cpus" will run one job per CPU core.
133
134              When there are multiple git remotes, pushes will be made to them
135              in parallel. Pulls are not done in parallel because  that  tends
136              to  be  less  efficient. When --content is synced, the files are
137              processed in parallel as well.
138
139       --resolvemerge, --no-resolvemerge
140              By default, merge conflicts are automatically handled  by  sync.
141              When  two  conflicting  versions  of a file have been committed,
142              both will be added to the tree, under different  filenames.  For
143              example,  file  "foo" would be replaced with "foo.variant-A" and
144              "foo.variant-B". (See git-annex-resolvemerge(1) for details.)
145
146              Use --no-resolvemerge to disable this automatic  merge  conflict
147              resolution.  It  can  also be disabled by setting annex.resolve‐
148              merge to false.
149
150       --cleanup
151              Removes the local and remote synced/ branches, which  were  cre‐
152              ated and pushed by git-annex sync.
153
154              This  can  come  in handy when you've synced a change to remotes
155              and now want to  reset  your  master  branch  back  before  that
156              change. So you run git reset and force-push the master branch to
157              remotes, only to find that the next git annex merge or git annex
158              sync  brings  the  changes  back. Why? Because the synced/master
159              branch is hanging around and still has the change in it.  Clean‐
160              ing up the synced/ branches prevents that problem.
161

SEE ALSO

163       git-annex(1)
164
165       git-annex-preferred-content(1)
166

AUTHOR

168       Joey Hess <id@joeyh.name>
169
170                                                             git-annex-sync(1)
Impressum