Skip to content

Commit 5c0663e

Browse files
committed
maintaining: explain how "git describe" works with lightweight tags
Once upon a time, "git describe" worked only with annotated tags; these days, using "--tags" option allows use of lightweight tags. Signed-off-by: Robert P. J. Day <[email protected]>
1 parent 7a13f5a commit 5c0663e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

book/05-distributed-git/sections/maintaining.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ This way, you can export a snapshot or build and name it something understandabl
497497
In fact, if you build Git from source code cloned from the Git repository, `git --version` gives you something that looks like this.
498498
If you're describing a commit that you have directly tagged, it gives you simply the tag name.
499499
500-
The `git describe` command favors annotated tags (tags created with the `-a` or `-s` flag), so release tags should be created this way if you're using `git describe`, to ensure the commit is named properly when described.
500+
By default, the `git describe` command requires annotated tags (tags created with the `-a` or `-s` flag); if you want to take advantage of lightweight (non-annotated) tags as well, add the `--tags` option to the command.
501501
You can also use this string as the target of a `git checkout` or `git show` command, although it relies on the abbreviated SHA-1 value at the end, so it may not be valid forever.
502502
For instance, the Linux kernel recently jumped from 8 to 10 characters to ensure SHA-1 object uniqueness, so older `git describe` output names were invalidated.
503503

0 commit comments

Comments
 (0)