Skip to content

Instantly share code, notes, and snippets.

@hellodword
Created April 21, 2024 13:44
Show Gist options
  • Save hellodword/26c40928872c6d4a4d472c0d0f8b8d43 to your computer and use it in GitHub Desktop.
Save hellodword/26c40928872c6d4a4d472c0d0f8b8d43 to your computer and use it in GitHub Desktop.
go mod pseudo-version

a pre-release version that encodes a revision identifier (such as a Git commit hash) and a timestamp from a version control system A timestamp (yyyymmddhhmmss), which is the UTC time the revision was created. In Git, this is the commit time, not the author time.

git --no-pager log --format="%cd-%H" -1 --date=format:"%Y%m%d%H%M%S"

git describe --tags --abbrev=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment