-
Notifications
You must be signed in to change notification settings - Fork 1
Add MinorVersionTag
external help file: GitVersioning-help.xml
Module Name: WhatsNews
schema: 2.0.0
Adds a new minor version tag to the current git repository.
Add-MinorVersionTag [-Message] <String> [-CurrentBranchOnly] [<CommonParameters>]
Finds the most recent git tag in the current repository that has the form v0.0.0
, increments the minor version number according to semantic versioning rules, and adds a new annotated git tag with the updated version number.
PS C:\> Add-MinorVersionTag -m "New features ahoy!"
Increments the minor version and appends a new git tag to the HEAD commit.
The message to associate with the new tag.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
By default, all branches are searched for the most recent version tag which is then used as the basis for the next version. However, -CurrentBranchOnly
restricts this search to the the lineage of the current branch. The default is preferable if you want versions to span the entire repository; CurrentBranchOnly
is preferrable if you want versions restricted to particular branches.
For example...
Let's say you have a repository with a commit tagged v6.0.0
in one branch and another tagged v5.2.3
in a different branch. Now let's say you need to make a change to the v5.X.X
branch that shouldn't be considered part of v6.0.0
. In that scenario, you should use Add-PatchVersion -CurrentBranchOnly -Message 'Fixed the thing'
to create a new tag v5.2.4
. If you didn't specify -CurrentBranchOnly
-- regardless of which branch you're currently on -- the next version generated by Add-PatchVersion
would be v6.0.1
because it would determine that across all branches v6.0.0
is the most recent version and would use it as the basis for the next version.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.