Skip to content

Commit 110e27b

Browse files
authored
Merge pull request #866 from rpjday/tagging
Add TIP to tagging section explaining "-l"; also some rewording
2 parents 72d6a54 + a402fcf commit 110e27b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

book/02-git-basics/sections/tagging.asc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In this section, you'll learn how to list the available tags, how to create new
99
==== Listing Your Tags
1010

1111
Listing the available tags in Git is straightforward.
12-
Just type `git tag`:(((git commands, tag)))
12+
Just type `git tag` (with optional `-l` or `--list`):(((git commands, tag)))
1313

1414
[source,console]
1515
----
@@ -20,7 +20,7 @@ v1.3
2020

2121
This command lists the tags in alphabetical order; the order in which they appear has no real importance.
2222

23-
You can also search for tags with a particular pattern.
23+
You can also search for tags that match a particular pattern.
2424
The Git source repo, for instance, contains more than 500 tags.
2525
If you're only interested in looking at the 1.8.5 series, you can run this:
2626

@@ -39,9 +39,17 @@ v1.8.5.4
3939
v1.8.5.5
4040
----
4141

42+
[NOTE]
43+
.Listing tag wildcards requires `-l` or `--list` option
44+
====
45+
If you want just the entire list of tags, running the command `git tag` implicitly assumes you want a listing and provides one; the use of `-l` or `--list` in this case is optional.
46+
47+
If, however, you're supplying a wildcard pattern to match tag names, the use of `-l` or `--list` is mandatory.
48+
====
49+
4250
==== Creating Tags
4351

44-
Git uses two main types of tags: lightweight and annotated.
52+
Git supports two types of tags: _lightweight_ and _annotated_.
4553

4654
A lightweight tag is very much like a branch that doesn't change – it's just a pointer to a specific commit.
4755

@@ -93,7 +101,7 @@ That shows the tagger information, the date the commit was tagged, and the annot
93101
(((tags, lightweight)))
94102
Another way to tag commits is with a lightweight tag.
95103
This is basically the commit checksum stored in a file – no other information is kept.
96-
To create a lightweight tag, don't supply the `-a`, `-s`, or `-m` option:
104+
To create a lightweight tag, don't supply any of the `-a`, `-s`, or `-m` options, just provide a tag name:
97105

98106
[source,console]
99107
----

0 commit comments

Comments
 (0)