Skip to content

Commit

Permalink
Add TIP to tagging section explaining "-l"; also some rewording
Browse files Browse the repository at this point in the history
  - Clarify the need for [-l|--llist]
  - Some minor rewording
  • Loading branch information
rpjday committed Oct 16, 2017
1 parent acb7169 commit a402fcf
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions book/02-git-basics/sections/tagging.asc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
----
Expand All @@ -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:

Expand All @@ -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.

Expand Down Expand Up @@ -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]
----
Expand Down

0 comments on commit a402fcf

Please sign in to comment.