From a402fcf53fb0d8d0c165ca9ee9ce233ea955cb85 Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Mon, 16 Oct 2017 01:44:21 -0700 Subject: [PATCH] Add TIP to tagging section explaining "-l"; also some rewording - Clarify the need for [-l|--llist] - Some minor rewording --- book/02-git-basics/sections/tagging.asc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/book/02-git-basics/sections/tagging.asc b/book/02-git-basics/sections/tagging.asc index 3ee8ee9e8..93b089f90 100644 --- a/book/02-git-basics/sections/tagging.asc +++ b/book/02-git-basics/sections/tagging.asc @@ -9,7 +9,7 @@ In this section, you'll learn how to list the available tags, how to create new ==== Listing Your Tags Listing the available tags in Git is straightforward. -Just type `git tag`:(((git commands, tag))) +Just type `git tag` (with optional `-l` or `--list`):(((git commands, tag))) [source,console] ---- @@ -20,7 +20,7 @@ v1.3 This command lists the tags in alphabetical order; the order in which they appear has no real importance. -You can also search for tags with a particular pattern. +You can also search for tags that match a particular pattern. The Git source repo, for instance, contains more than 500 tags. If you're only interested in looking at the 1.8.5 series, you can run this: @@ -39,9 +39,17 @@ v1.8.5.4 v1.8.5.5 ---- +[NOTE] +.Listing tag wildcards requires `-l` or `--list` option +==== +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. + +If, however, you're supplying a wildcard pattern to match tag names, the use of `-l` or `--list` is mandatory. +==== + ==== Creating Tags -Git uses two main types of tags: lightweight and annotated. +Git supports two types of tags: _lightweight_ and _annotated_. A lightweight tag is very much like a branch that doesn't change – it's just a pointer to a specific commit. @@ -93,7 +101,7 @@ That shows the tagger information, the date the commit was tagged, and the annot (((tags, lightweight))) Another way to tag commits is with a lightweight tag. This is basically the commit checksum stored in a file – no other information is kept. -To create a lightweight tag, don't supply the `-a`, `-s`, or `-m` option: +To create a lightweight tag, don't supply any of the `-a`, `-s`, or `-m` options, just provide a tag name: [source,console] ----