Skip to content

git commands

Alan B. Christie edited this page Feb 25, 2026 · 2 revisions

Here are a few relatively common (and handy) git commands.

There is also an extremely useful, and comprehensive, official git cheat-sheet.


Seeing the commit log
You can inspect commit messages on a branch (e.g. main) and their commit checksums: -

git log main --pretty=oneline
Display tags
Here we list tags that start "2026.": -

git tag -l "2026.*"

You can also get detailed for a tag
include who made it, when and the message: -

git show 2026.01.1
Checkout a tag
git checkout 2026.02.1
Creating a tag
Annotated tags are preferred over lightweight tags.
we provide -a to indicate it's annotated and then
provide a simple message on the command-line.
Alternatively, omit the -m and its message
to enter an editor where you can provide a more detailed
message.

git tag -a 2026.02.2 -m "Release 2026.02.2"
Creating a tag (for a prior commit)
To tag a prior commit, you simply have to add the commit checksum
(or part of it) to the end of the tag command:-

git tag -a 2026.02.2 9fceb02

Clone this wiki locally