@@ -25,37 +25,16 @@ value is <old-oid>. You can specify 40 "0" or an empty string
25
25
as <old-oid> to make sure that the ref you are creating does
26
26
not exist.
27
27
28
- It also allows a "ref" file to be a symbolic pointer to another
29
- ref file by starting with the four-byte header sequence of
30
- "ref:".
31
-
32
- More importantly, it allows the update of a ref file to follow
33
- these symbolic pointers, whether they are symlinks or these
34
- "regular file symbolic refs". It follows *real* symlinks only
35
- if they start with "refs/": otherwise it will just try to read
36
- them and update them as a regular file (i.e. it will allow the
37
- filesystem to follow them, but will overwrite such a symlink to
38
- somewhere else with a regular filename).
28
+ The final arguments are object names; this command without any options
29
+ does not support updating a symbolic ref to point to another ref (see
30
+ linkgit:git-symbolic-ref[1]). But `git update-ref --stdin` does have
31
+ the `symref-*` commands so that regular refs and symbolic refs can be
32
+ committed in the same transaction.
39
33
40
34
If --no-deref is given, <ref> itself is overwritten, rather than
41
35
the result of following the symbolic pointers.
42
36
43
- In general, using
44
-
45
- git update-ref HEAD "$head"
46
-
47
- should be a _lot_ safer than doing
48
-
49
- echo "$head" > "$GIT_DIR/HEAD"
50
-
51
- both from a symlink following standpoint *and* an error checking
52
- standpoint. The "refs/" rule for symlinks means that symlinks
53
- that point to "outside" the tree are safe: they'll be followed
54
- for reading but not for writing (so we'll never write through a
55
- ref symlink to some other tree, if you have copied a whole
56
- archive by creating a symlink tree).
57
-
58
- With `-d` flag, it deletes the named <ref> after verifying it
37
+ With `-d`, it deletes the named <ref> after verifying that it
59
38
still contains <old-oid>.
60
39
61
40
With `--stdin`, update-ref reads instructions from standard input and
@@ -200,6 +179,21 @@ An update will fail (without changing <ref>) if the current user is
200
179
unable to create a new log file, append to the existing log file
201
180
or does not have committer information available.
202
181
182
+ NOTES
183
+ -----
184
+
185
+ Symbolic refs were initially implemented using symbolic links. This is
186
+ now deprecated since not all filesystems support symbolic links.
187
+
188
+ This command follows *real* symlinks only if they start with "refs/":
189
+ otherwise it will just try to read them and update them as a regular
190
+ file (i.e. it will allow the filesystem to follow them, but will
191
+ overwrite such a symlink to somewhere else with a regular filename).
192
+
193
+ SEE ALSO
194
+ --------
195
+ linkgit:git-symbolic-ref[1]
196
+
203
197
GIT
204
198
---
205
199
Part of the linkgit:git[1] suite
0 commit comments