1git-annex-sync(1) General Commands Manual git-annex-sync(1)
2
3
4
6 git-annex-sync - synchronize local repository with remotes
7
9 git annex sync [remote ...]
10
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 synced/master 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 Note that syncing with a remote will not normally update the remote's
26 working tree with changes made to the local repository. (Unless it's
27 configured with receive.denyCurrentBranch=updateInstead.) However,
28 those changes are pushed to the remote, so they can be merged into its
29 working tree by running "git annex sync" on the remote.
30
32 [remote]
33
34 By default, all remotes are synced, except for remotes that have
35 remote.<name>.annex-sync set to false. By specifying the names
36 of remotes (or remote groups), you can control which ones to
37 sync with.
38
39 --fast Only sync with the remotes with the lowest annex-cost value con‐
40 figured.
41
42 --commit, --no-commit
43 A commit is done by default (unless annex.autocommit is set to
44 false).
45
46 Use --no-commit to avoid committing local changes.
47
48 --message=msg
49 Use this option to specify a commit message.
50
51 --pull, --no-pull
52 By default, git pulls from remotes. Use --no-pull to disable all
53 pulling.
54
55 When remote.<name>.annex-pull or remote.<name>.annex-sync are
56 set to false, pulling is disabled for those remotes, and using
57 --pull will not enable it.
58
59 --push, --no-push
60 By default, git pushes changes to remotes. Use --no-push to
61 disable all pushing.
62
63 When remote.<name>.annex-push or remote.<name>.annex-sync are
64 set to false, or remote.<name>.annex-readonly is set to true,
65 pushing is disabled for those remotes, and using --push will not
66 enable it.
67
68 --content, --no-content
69 Normally, syncing does not transfer the contents of annexed
70 files. The --content option causes the content of files in the
71 work tree to also be uploaded and downloaded as necessary.
72
73 The annex.synccontent configuration can be set to true to make
74 content be synced by default.
75
76 Normally this tries to get each annexed file in the work tree
77 that the local repository does not yet have, and then copies
78 each file in the work tree to every remote that it is syncing
79 with. This behavior can be overridden by configuring the pre‐
80 ferred content of a repository. See git-annex-preferred-con‐
81 tent(1).
82
83 When a special remote is configured as an export and is tracking
84 a branch, the export will be updated to the current content of
85 the branch. See git-annex-export(1).
86
87 --content-of=path -C path
88 While --content operates on all annexed files in the work tree,
89 --content-of allows limiting the transferred files to ones in a
90 given location.
91
92 This option can be repeated multiple times with different paths.
93
94 --all -A
95 This option, when combined with --content, makes all available
96 versions of all files be synced, when preferred content settings
97 allow.
98
99 Note that preferred content settings that use include= or
100 exclude= will only match the version of files currently in the
101 work tree, but not past versions of files.
102
103 --jobs=N -JN
104 Enables parallel syncing with up to the specified number of jobs
105 running at once. For example: -J10
106
107 When there are multiple git remotes, pushes will be made to them
108 in parallel. Pulls are not done in parallel because that tends
109 to be less efficient. When --content is synced, the files are
110 processed in parallel as well.
111
112 --resolvemerge, --no-resolvemerge
113 By default, merge conflicts are automatically handled by sync.
114 When two conflicting versions of a file have been committed,
115 both will be added to the tree, under different filenames. For
116 example, file "foo" would be replaced with "foo.variant-A" and
117 "foo.variant-B". (See git-annex-resolvemerge(1) for details.)
118
119 Use --no-resolvemerge to disable this automatic merge conflict
120 resolution. It can also be disabled by setting annex.resolve‐
121 merge to false.
122
123 --cleanup
124 Removes the local and remote synced/ branches, which were cre‐
125 ated and pushed by git-annex sync.
126
127 This can come in handy when you've synced a change to remotes
128 and now want to reset your master branch back before that
129 change. So you run git reset and force-push the master branch to
130 remotes, only to find that the next git annex merge or git annex
131 sync brings the changes back. Why? Because the synced/master
132 branch is hanging around and still has the change in it. Clean‐
133 ing up the synced/ branches prevents that problem.
134
136 git-annex(1)
137
138 git-annex-preferred-content(1)
139
141 Joey Hess <id@joeyh.name>
142
143 git-annex-sync(1)