Skip to content

Commit 81b6c95

Browse files
author
J. Bruce Fields
committed
user-manual: introduce "branch" and "branch head" differently
I was using "branch" to mean "head", but that's perhaps a little sloppy; so instead start by using the terms "branch head" and "head", while still quickly falling back on "branch", since that's what people actually say more frequently. Also include glossary references on the first uses of "head" and "tag". Signed-off-by: "J. Bruce Fields" <[email protected]>
1 parent cbd9192 commit 81b6c95

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

Documentation/user-manual.txt

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -288,21 +288,22 @@ collection of files. It stores the history as a compressed
288288
collection of interrelated snapshots (versions) of the project's
289289
contents.
290290

291-
A single git repository may contain multiple branches. Each branch
292-
is a bookmark referencing a particular point in the project history.
293-
The gitlink:git-branch[1] command shows you the list of branches:
291+
A single git repository may contain multiple branches. It keeps track
292+
of them by keeping a list of <<def_head,heads>> which reference the
293+
latest version on each branch; the gitlink:git-branch[1] command shows
294+
you the list of branch heads:
294295

295296
------------------------------------------------
296297
$ git branch
297298
* master
298299
------------------------------------------------
299300

300-
A freshly cloned repository contains a single branch, named "master",
301-
and the working directory contains the version of the project
302-
referred to by the master branch.
301+
A freshly cloned repository contains a single branch head, named
302+
"master", and working directory is initialized to the state of
303+
the project referred to by "master".
303304

304-
Most projects also use tags. Tags, like branches, are references
305-
into the project's history, and can be listed using the
305+
Most projects also use <<def_tag,tags>>. Tags, like heads, are
306+
references into the project's history, and can be listed using the
306307
gitlink:git-tag[1] command:
307308

308309
------------------------------------------------
@@ -320,9 +321,9 @@ v2.6.13
320321
------------------------------------------------
321322

322323
Tags are expected to always point at the same version of a project,
323-
while branches are expected to advance as development progresses.
324+
while heads are expected to advance as development progresses.
324325

325-
Create a new branch pointing to one of these versions and check it
326+
Create a new branch head pointing to one of these versions and check it
326327
out using gitlink:git-checkout[1]:
327328

328329
------------------------------------------------
@@ -346,10 +347,10 @@ the current branch to point at v2.6.17 instead, with
346347
$ git reset --hard v2.6.17
347348
------------------------------------------------
348349

349-
Note that if the current branch was your only reference to a
350+
Note that if the current branch head was your only reference to a
350351
particular point in history, then resetting that branch may leave you
351-
with no way to find the history it used to point to; so use this
352-
command carefully.
352+
with no way to find the history it used to point to; so use this command
353+
carefully.
353354

354355
Understanding History: Commits
355356
------------------------------
@@ -452,17 +453,15 @@ be replaced with another letter or number.
452453
Understanding history: What is a branch?
453454
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
454455

455-
Though we've been using the word "branch" to mean a kind of reference
456-
to a particular commit, the word branch is also commonly used to
457-
refer to the line of commits leading up to that point. In the
458-
example above, git may think of the branch named "A" as just a
459-
pointer to one particular commit, but we may refer informally to the
460-
line of three commits leading up to that point as all being part of
456+
When we need to be precise, we will use the word "branch" to mean a line
457+
of development, and "branch head" (or just "head") to mean a reference
458+
to the most recent commit on a branch. In the example above, the branch
459+
head named "A" is a pointer to one particular commit, but we refer to
460+
the line of three commits leading up to that point as all being part of
461461
"branch A".
462462

463-
If we need to make it clear that we're just talking about the most
464-
recent commit on the branch, we may refer to that commit as the
465-
"head" of the branch.
463+
However, when no confusion will result, we often just use the term
464+
"branch" both for branches and for branch heads.
466465

467466
Manipulating branches
468467
---------------------

0 commit comments

Comments
 (0)