You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/02-git-basics/sections/tagging.asc
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ In this section, you'll learn how to list the available tags, how to create new
9
9
==== Listing Your Tags
10
10
11
11
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)))
13
13
14
14
[source,console]
15
15
----
@@ -20,7 +20,7 @@ v1.3
20
20
21
21
This command lists the tags in alphabetical order; the order in which they appear has no real importance.
22
22
23
-
You can also search for tags with a particular pattern.
23
+
You can also search for tags that match a particular pattern.
24
24
The Git source repo, for instance, contains more than 500 tags.
25
25
If you're only interested in looking at the 1.8.5 series, you can run this:
26
26
@@ -39,9 +39,17 @@ v1.8.5.4
39
39
v1.8.5.5
40
40
----
41
41
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
+
42
50
==== Creating Tags
43
51
44
-
Git uses two main types of tags: lightweight and annotated.
52
+
Git supports two types of tags: _lightweight_ and _annotated_.
45
53
46
54
A lightweight tag is very much like a branch that doesn't change – it's just a pointer to a specific commit.
47
55
@@ -93,7 +101,7 @@ That shows the tagger information, the date the commit was tagged, and the annot
93
101
(((tags, lightweight)))
94
102
Another way to tag commits is with a lightweight tag.
95
103
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:
0 commit comments