{"id":15011683,"url":"https://github.com/dasmulli/simplegitversion","last_synced_at":"2025-08-01T04:18:38.724Z","repository":{"id":47479402,"uuid":"84232935","full_name":"dasMulli/SimpleGitVersion","owner":"dasMulli","description":"Simple Git prerelease versioning integrated into SDK-based msbuild projects","archived":false,"fork":false,"pushed_at":"2019-10-14T20:35:52.000Z","size":30,"stargazers_count":18,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T23:34:54.536Z","etag":null,"topics":["dotnet","git","msbuild","nuget-package","versioning"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dasMulli.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":"2017-03-07T18:34:19.000Z","updated_at":"2024-11-09T21:52:16.000Z","dependencies_parsed_at":"2022-09-16T13:51:10.839Z","dependency_job_id":null,"html_url":"https://github.com/dasMulli/SimpleGitVersion","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasMulli%2FSimpleGitVersion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasMulli%2FSimpleGitVersion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasMulli%2FSimpleGitVersion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasMulli%2FSimpleGitVersion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dasMulli","download_url":"https://codeload.github.com/dasMulli/SimpleGitVersion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248512828,"owners_count":21116686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["dotnet","git","msbuild","nuget-package","versioning"],"created_at":"2024-09-24T19:41:26.343Z","updated_at":"2025-04-12T03:32:03.987Z","avatar_url":"https://github.com/dasMulli.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Super simple Git prerelease versioning\nThis is a build utility package that adjusts your `csproj` / `vbproj` project's NuGet and `AssemblyInformalVersion` based on the current git repository's branch name and commit count by making use of the VS 2017 SDK-based project system.\n\nUse it like this in your project:\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n    \u003cPropertyGroup\u003e\n        \u003cTargetFramework\u003enetstandard1.6\u003c/TargetFramework\u003e\n        \u003cVersionPrefix\u003e1.2.3\u003c/VersionPrefix\u003e\n    \u003c/PropertyGroup\u003e\n    \u003cItemGroup\u003e\n        \u003cPackageReference Include=\"DasMulli.SimpleGitVersion\" Version=\"1.0.0-*\" PrivateAssets=\"All\" /\u003e\n    \u003c/ItemGroup\u003e\n\u003c/Project\u003e\n```\n\nIf you are on the `master` branch and have 23 commits, the resulting version will be:\n```\n1.2.3-master-0000023\n```\n\nIf you are on the `feature/awesome` branch and have 25 commits, the resulting version will be:\n```\n1.2.3-feature-awesome-0000025\n```\n\n## Define Release labels for known branches\n\nFor known branches, you can define custom release lables (think of it as branch name to label dictionary):\n\n```xml\n\u003cItemGroup\u003e\n  \u003cGitBranchToReleaseLabelMapping Include=\"master\" ReleaseLabel=\"rc\" /\u003e\n  \u003cGitBranchToReleaseLabelMapping Include=\"develop\" ReleaseLabel=\"beta\" /\u003e\n\u003c/ItemGroup\u003e\n```\n\nIf you are on the `master` branch and have 23 commits, the resulting version will be:\n```\n1.2.3-rc-0000023\n```\n\nIf you are on the `feature/awesome` branch and have 25 commits, the resulting version will be:\n```\n1.2.3-feature-awesome-0000025\n```\n\n## SemVer 2.0.0\n\nFor SemVer 2.0.0, you'll want your branch name and commit count be separate prerelease lables, separated by a single dot (`.`) and no zero-padding for the commit count. This can be enabled by setting the property `UseCompatGitVersion` to `false`.\nBecause older NuGet clients and feeds(!!) might not fully support SemVer 2.0.0, the \"compatible\" SemVer 1.0.0 version is used by default. Note that the support for pre-set `VersionSuffix` values is limited (there will be a dash).\n\nBut if you like to live dangerously, you can easily enable SemVer 2.0.0 versions using:\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n    \u003cPropertyGroup\u003e\n        \u003cTargetFramework\u003enetstandard1.6\u003c/TargetFramework\u003e\n        \u003cVersionPrefix\u003e1.2.3\u003c/VersionPrefix\u003e\n        \u003cUseCompatGitVersion\u003efalse\u003c/UseCompatGitVersion\u003e\n    \u003c/PropertyGroup\u003e\n    \u003cItemGroup\u003e\n        \u003cPackageReference Include=\"DasMulli.SimpleGitVersion\" Version=\"1.0.0-*\" PrivateAssets=\"All\" /\u003e\n    \u003c/ItemGroup\u003e\n\u003c/Project\u003e\n```\n\nIf you are on the `master` branch and have 23 commits, the resulting version will be:\n```\n1.2.3-master.23\n```\n\nIf you are on the `feature/awesome` branch and have 25 commits, the resulting version will be:\n```\n1.2.3-feature-awesome.25\n```\n\n## Omit branch name in version suffix but use a custom label\n\nThe well-known `VersionPrefix` is considered while the final version is calculated, so you can define it yourself and tell `SimpleGitVersion` to not care about branch names:\n\n\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n    \u003cPropertyGroup\u003e\n        \u003cTargetFramework\u003enetstandard1.6\u003c/TargetFramework\u003e\n        \u003cVersionPrefix\u003e1.2.3\u003c/VersionPrefix\u003e\n        \u003cVersionSuffix\u003efoo\u003c/VersionSuffix\u003e\n        \u003cIncludeBranchInGitVersion\u003efalse\u003c/IncludeBranchInGitVersion\u003e\n    \u003c/PropertyGroup\u003e\n    \u003cItemGroup\u003e\n        \u003cPackageReference Include=\"DasMulli.SimpleGitVersion\" Version=\"1.0.0-*\" PrivateAssets=\"All\" /\u003e\n    \u003c/ItemGroup\u003e\n\u003c/Project\u003e\n```\n\nIf you are on ANY branch and have 23 commits, the resulting version will be:\n```\n1.2.3-foo-0000023\n```\n\n## Manually disable prerelease version generation\n\nFor release builds, you usually want to omit prerelease versions being generated. There is a property that can be used to disable all git version generation: `DisableGitVersionSuffix`. You can use it like this in your build scripts (not that a prerelease version will still be generated if you set `VersionSuffix` in your project file):\n\n```sh\n\u003e dotnet pack /p:DisableGitVersionSuffix=true\n```\n\n## More control and re-using the values calculated by SimpleGitVersion\n\nSee the [msbuild target's inline documentation](DasMulli.SimpleGitVersion/build/DasMulli.SimpleGitVersion.targets) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasmulli%2Fsimplegitversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdasmulli%2Fsimplegitversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasmulli%2Fsimplegitversion/lists"}