@@ -3,20 +3,69 @@ git-remote-helpers(1)
3
3
4
4
NAME
5
5
----
6
- git-remote-helpers - Helper programs for interoperation with remote git
6
+ git-remote-helpers - Helper programs to interact with remote repositories
7
7
8
8
SYNOPSIS
9
9
--------
10
- 'git remote-<transport>' <remote>
10
+ 'git remote-<transport>' <repository> [<URL>]
11
11
12
12
DESCRIPTION
13
13
-----------
14
14
15
- These programs are normally not used directly by end users, but are
16
- invoked by various git programs that interact with remote repositories
17
- when the repository they would operate on will be accessed using
18
- transport code not linked into the main git binary. Various particular
19
- helper programs will behave as documented here.
15
+ Remote helper programs are normally not used directly by end users,
16
+ but they are invoked by git when it needs to interact with remote
17
+ repositories git does not support natively. A given helper will
18
+ implement a subset of the capabilities documented here. When git
19
+ needs to interact with a repository using a remote helper, it spawns
20
+ the helper as an independent process, sends commands to the helper's
21
+ standard input, and expects results from the helper's standard
22
+ output. Because a remote helper runs as an independent process from
23
+ git, there is no need to re-link git to add a new helper, nor any
24
+ need to link the helper with the implementation of git.
25
+
26
+ Every helper must support the "capabilities" command, which git will
27
+ use to determine what other commands the helper will accept. Other
28
+ commands generally concern facilities like discovering and updating
29
+ remote refs, transporting objects between the object database and
30
+ the remote repository, and updating the local object store.
31
+
32
+ Helpers supporting the 'fetch' capability can discover refs from the
33
+ remote repository and transfer objects reachable from those refs to
34
+ the local object store. Helpers supporting the 'push' capability can
35
+ transfer local objects to the remote repository and update remote refs.
36
+
37
+ Git comes with a "curl" family of remote helpers, that handle various
38
+ transport protocols, such as 'git-remote-http', 'git-remote-https',
39
+ 'git-remote-ftp' and 'git-remote-ftps'. They implement the capabilities
40
+ 'fetch', 'option', and 'push'.
41
+
42
+ INVOCATION
43
+ ----------
44
+
45
+ Remote helper programs are invoked with one or (optionally) two
46
+ arguments. The first argument specifies a remote repository as in git;
47
+ it is either the name of a configured remote or a URL. The second
48
+ argument specifies a URL; it is usually of the form
49
+ '<transport>://<address>', but any arbitrary string is possible.
50
+
51
+ When git encounters a URL of the form '<transport>://<address>', where
52
+ '<transport>' is a protocol that it cannot handle natively, it
53
+ automatically invokes 'git remote-<transport>' with the full URL as
54
+ the second argument. If such a URL is encountered directly on the
55
+ command line, the first argument is the same as the second, and if it
56
+ is encountered in a configured remote, the first argument is the name
57
+ of that remote.
58
+
59
+ A URL of the form '<transport>::<address>' explicitly instructs git to
60
+ invoke 'git remote-<transport>' with '<address>' as the second
61
+ argument. If such a URL is encountered directly on the command line,
62
+ the first argument is '<address>', and if it is encountered in a
63
+ configured remote, the first argument is the name of that remote.
64
+
65
+ Additionally, when a configured remote has 'remote.<name>.vcs' set to
66
+ '<transport>', git explicitly invokes 'git remote-<transport>' with
67
+ '<name>' as the first argument. If set, the second argument is
68
+ 'remote.<name>.url'; otherwise, the second argument is omitted.
20
69
21
70
COMMANDS
22
71
--------
@@ -25,8 +74,8 @@ Commands are given by the caller on the helper's standard input, one per line.
25
74
26
75
'capabilities'::
27
76
Lists the capabilities of the helper, one per line, ending
28
- with a blank line. Each capability may be preceded with '*'.
29
- This marks them mandatory for git version using the remote
77
+ with a blank line. Each capability may be preceded with '*',
78
+ which marks them mandatory for git version using the remote
30
79
helper to understand (unknown mandatory capability is fatal
31
80
error).
32
81
@@ -35,27 +84,27 @@ Commands are given by the caller on the helper's standard input, one per line.
35
84
[<attr> ...]". The value may be a hex sha1 hash, "@<dest>" for
36
85
a symref, or "?" to indicate that the helper could not get the
37
86
value of the ref. A space-separated list of attributes follows
38
- the name; unrecognized attributes are ignored. After the
39
- complete list, outputs a blank line.
87
+ the name; unrecognized attributes are ignored. The list ends
88
+ with a blank line.
40
89
+
41
90
If 'push' is supported this may be called as 'list for-push'
42
91
to obtain the current refs prior to sending one or more 'push'
43
92
commands to the helper.
44
93
45
94
'option' <name> <value>::
46
- Set the transport helper option <name> to <value>. Outputs a
95
+ Sets the transport helper option <name> to <value>. Outputs a
47
96
single line containing one of 'ok' (option successfully set),
48
97
'unsupported' (option not recognized) or 'error <msg>'
49
- (option <name> is supported but <value> is not correct
98
+ (option <name> is supported but <value> is not valid
50
99
for it). Options should be set before other commands,
51
- and may how those commands behave .
100
+ and may influence the behavior of those commands.
52
101
+
53
102
Supported if the helper has the "option" capability.
54
103
55
104
'fetch' <sha1> <name>::
56
105
Fetches the given object, writing the necessary objects
57
106
to the database. Fetch commands are sent in a batch, one
58
- per line, and the batch is terminated with a blank line.
107
+ per line, terminated with a blank line.
59
108
Outputs a single blank line when all fetch commands in the
60
109
same batch are complete. Only objects which were reported
61
110
in the ref list with a sha1 may be fetched this way.
@@ -67,7 +116,7 @@ suitably updated.
67
116
Supported if the helper has the "fetch" capability.
68
117
69
118
'push' +<src>:<dst>::
70
- Pushes the given <src> commit or branch locally to the
119
+ Pushes the given local <src> commit or branch to the
71
120
remote branch described by <dst>. A batch sequence of
72
121
one or more push commands is terminated with a blank line.
73
122
+
@@ -91,6 +140,9 @@ Supported if the helper has the "push" capability.
91
140
by applying the refspecs from the "refspec" capability to the
92
141
name of the ref.
93
142
+
143
+ Especially useful for interoperability with a foreign versioning
144
+ system.
145
+ +
94
146
Supported if the helper has the "import" capability.
95
147
96
148
'connect' <service>::
@@ -119,16 +171,11 @@ CAPABILITIES
119
171
------------
120
172
121
173
'fetch'::
122
- This helper supports the 'fetch' command.
123
-
124
174
'option'::
125
- This helper supports the option command.
126
-
127
175
'push'::
128
- This helper supports the 'push' command.
129
-
130
176
'import'::
131
- This helper supports the 'import' command.
177
+ 'connect'::
178
+ This helper supports the corresponding command with the same name.
132
179
133
180
'refspec' 'spec'::
134
181
When using the import command, expect the source ref to have
@@ -140,9 +187,6 @@ CAPABILITIES
140
187
all, it must cover all refs reported by the list command; if
141
188
it is not used, it is effectively "*:*"
142
189
143
- 'connect'::
144
- This helper supports the 'connect' command.
145
-
146
190
REF LIST ATTRIBUTES
147
191
-------------------
148
192
@@ -158,19 +202,19 @@ REF LIST ATTRIBUTES
158
202
OPTIONS
159
203
-------
160
204
'option verbosity' <N>::
161
- Change the level of messages displayed by the helper.
162
- When N is 0 the end-user has asked the process to be
163
- quiet , and the helper should produce only error output.
164
- N of 1 is the default level of verbosity, higher values
205
+ Changes the verbosity of messages displayed by the helper.
206
+ A value of 0 for N means that processes operate
207
+ quietly , and the helper produces only error output.
208
+ 1 is the default level of verbosity, and higher values
165
209
of N correspond to the number of -v flags passed on the
166
210
command line.
167
211
168
212
'option progress' \{'true'|'false'\}::
169
- Enable (or disable ) progress messages displayed by the
213
+ Enables (or disables ) progress messages displayed by the
170
214
transport helper during a command.
171
215
172
216
'option depth' <depth>::
173
- Deepen the history of a shallow repository.
217
+ Deepens the history of a shallow repository.
174
218
175
219
'option followtags' \{'true'|'false'\}::
176
220
If enabled the helper should automatically fetch annotated
@@ -186,11 +230,15 @@ OPTIONS
186
230
helpers this only applies to the 'push', if supported.
187
231
188
232
'option servpath <c-style-quoted-path>'::
189
- Set service path (--upload-pack, --receive-pack etc.) for
190
- next connect. Remote helper MAY support this option. Remote
191
- helper MUST NOT rely on this option being set before
233
+ Sets service path (--upload-pack, --receive-pack etc.) for
234
+ next connect. Remote helper may support this option, but
235
+ must not rely on this option being set before
192
236
connect request occurs.
193
237
238
+ SEE ALSO
239
+ --------
240
+ linkgit:git-remote[1]
241
+
194
242
Documentation
195
243
-------------
196
244
Documentation by Daniel Barkalow and Ilari Liusvaara
0 commit comments