Showing Tags in the Git Log
When working with Git, we frequently look at the log to see the last few changes. For example to show the last couple of commits:
~/Development/company/website (master) $ git log -2
commit 584770a00b3a3cd16a24ecc9e7c5f4af95c76354
Author: Matthew Speake <matthew.speake@gmail.com>
Date: Sat Nov 3 09:52:32 2018 +0000
Adding release package before applying tag
commit 04c6500551abb64753be948f1b9481e1bc430b44
Author: Matthew Speake <matthew.speake@gmail.com>
Date: Sat Nov 3 09:51:02 2018 +0000
checkin before deploy
This doesn’t show the tags though, so we can add tags with the --decorate
option. Combining this with a --oneline
format allows us to focus on on just commit messages and the tags they correspond to:
~/Development/company/website (master) $ git log -2 --decorate --oneline
584770a (HEAD -> master, tag: WEBSITE_RELEASE_0.1.16) Adding release package before applying tag
04c6500 (origin/master, origin/HEAD) checkin before deploy