Skip to content

Commit d9a4bb3

Browse files
committed
git.txt: HEAD is not that special
The introductory text in "git help git" that describes HEAD called it "a special ref". It is special compared to the more regular refs like refs/heads/master and refs/tags/v1.0.0, but not that special, unlike truly special ones like FETCH_HEAD. Rewrite a few sentences to also introduce the distinction between a regular ref that contain the object name and a symbolic ref that contain the name of another ref. Update the description of HEAD that point at the current branch to use the more correct term, a "symbolic ref". This was found as part of auditing the documentation and in-code comments for uses of "special ref" that refer merely a "pseudo ref". Signed-off-by: Junio C Hamano <[email protected]>
1 parent 564d025 commit d9a4bb3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Documentation/git.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,10 +1025,11 @@ When first created, objects are stored in individual files, but for
10251025
efficiency may later be compressed together into "pack files".
10261026

10271027
Named pointers called refs mark interesting points in history. A ref
1028-
may contain the SHA-1 name of an object or the name of another ref. Refs
1029-
with names beginning `ref/head/` contain the SHA-1 name of the most
1028+
may contain the SHA-1 name of an object or the name of another ref (the
1029+
latter is called a "symbolic ref").
1030+
Refs with names beginning `refs/head/` contain the SHA-1 name of the most
10301031
recent commit (or "head") of a branch under development. SHA-1 names of
1031-
tags of interest are stored under `ref/tags/`. A special ref named
1032+
tags of interest are stored under `refs/tags/`. A symbolic ref named
10321033
`HEAD` contains the name of the currently checked-out branch.
10331034

10341035
The index file is initialized with a list of all paths and, for each

0 commit comments

Comments
 (0)