{"id":25420228,"url":"https://github.com/aletheia7/gogitver","last_synced_at":"2026-04-05T17:37:02.056Z","repository":{"id":20849708,"uuid":"24136273","full_name":"aletheia7/gogitver","owner":"aletheia7","description":"Go package that embeds a git tag/version string in your application","archived":false,"fork":false,"pushed_at":"2019-11-20T01:25:32.000Z","size":34,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-14T23:45:17.194Z","etag":null,"topics":["git","go","golang","mage","magefile","make","makefile","semver","version"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aletheia7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-17T08:26:07.000Z","updated_at":"2024-10-19T18:06:50.000Z","dependencies_parsed_at":"2022-08-26T22:30:36.711Z","dependency_job_id":null,"html_url":"https://github.com/aletheia7/gogitver","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/aletheia7/gogitver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aletheia7%2Fgogitver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aletheia7%2Fgogitver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aletheia7%2Fgogitver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aletheia7%2Fgogitver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aletheia7","download_url":"https://codeload.github.com/aletheia7/gogitver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aletheia7%2Fgogitver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31444702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T15:22:31.103Z","status":"ssl_error","status_checked_at":"2026-04-05T15:22:00.205Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","go","golang","mage","magefile","make","makefile","semver","version"],"created_at":"2025-02-16T19:36:28.631Z","updated_at":"2026-04-05T17:37:02.027Z","avatar_url":"https://github.com/aletheia7.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/aletheia7/gogitver) \n\n#### gogitver and [mage (go make)](https://github.com/magefile/mage)\nA go package that inserts a git tag into your binary. Uses mage to efficiently \ncompile your go application when the git tag changes. Other source code changes\nwill still trigger a compile. The git version/tag is created beforehand with:\n```bash\ngit tag -a\n\n# View the git tag: \ngit describe --tags --long\n\n# Instead of \"go install\" execute:\nmage\n```\n\n#### Install and [mage](https://github.com/magefile/mage)\ngogitver must be installed as a package under your application main\ndirectory. E.g. if your application resides under ~/go/src/app, \ngogitver must be installed under ~/go/src/app/gogitver. ~/go/src/app/vendor/gogitver\nis preferred.\n\n```bash\n# Example\nmkdir ~/go/src/app/vendor/gogitver\ncd ~/go/src/app\ngit clone --depth 1 https://github.com/aletheia7/gogitver.git vendor/gogitver\nrm -fr vendor/gogitver/.git\n# link mage_gogitver.go \nln -s vendor/gogitver/mage_gogitver.go .\nAdd a mg.Dep(Gogitver) to your main magefile.go that should reside under ~/go/src/app .\n```\nCreate a git tag:\n```bash\ngit tag -a 1.0.7\n```\nRun mage:\n```bash\nmage\n```\n\n#### gogitver and [GNUMake](https://www.gnu.org/software/make/manual/make.html)\nA go package that inserts a git tag into your binary. Uses make to efficiently \ncompile your go application when the git tag changes. Other source code changes\nwill still trigger a compile. The git version/tag is created beforehand with:\n```bash\ngit tag -a\n\n# View the git tag: \ngit describe --tags --long\n\n# Instead of \"go install\" execute:\nmake\n# Run \"go install\" and strip to remove debug symbols:\nmake strip\n# Instead of \"go clean\" execute:\nmake clean\n```\n\n#### Install and [GNUMake](https://www.gnu.org/software/make/manual/make.html)\ngogitver must be installed as a package under your application main\ndirectory. E.g. if your application resides under ~/go/src/app, \ngogitver must be installed under ~/go/src/app/gogitver. ~/go/src/app/vendor/gogitver\nis preferred.\n\n```bash\n# Example\nmkdir ~/go/src/app/vendor/gogitver\ncd ~/go/src/app\ngit clone --depth 1 https://github.com/aletheia7/gogitver.git vendor/gogitver\nrm -fr vendor/gogitver/.git\n# link makefile\nln -s vendor/gogitver/makefile .\n```\nCreate a git tag:\n```bash\ngit tag -a 1.0.7\n```\nRun make:\n```bash\nmake\n```\n\n[GNUMake](https://www.gnu.org/software/make/manual/make.html)\n\nSoftware Version Guidelines: [Semantic Versioning](http://semver.org)\n\nCompare \u0026 parse semver version strings: [godoc go-semver](http://godoc.org/code.google.com/p/go-semver/version), [code: go-semver](https://code.google.com/p/go-semver/) \n#### Example\n\n```go\npackage main\nimport (\n\t\"fmt\"\n\t// Do not use \"github.com/alethiea7/gogitver\"\n\t// It will not work\n\t\"app/gogitver\"\n)\n\nfunc main() {\n\n\tfmt.Println(gogitver.Git())\t\n\tfmt.Println(gogitver.Tag())\n}\n```\n##### Ouput\n```bash\n1.0.7-0-g8e9e07b\n1.0.7\n```\n\n#### License \n\nUse of this source code is governed by a BSD-2-Clause license that can be found\nin the LICENSE file.\n\n[![BSD-2-Clause License](osi_logo_100X133_90ppi_0.png)](https://opensource.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faletheia7%2Fgogitver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faletheia7%2Fgogitver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faletheia7%2Fgogitver/lists"}