git-release - Man Page

Commit, tag and push changes to the repository

Examples (TL;DR)

Synopsis

git-release [<tagname> | --semver <name>] [-r <remote>] [-m <commit info>] [--no-empty-commit] [-c] [-s] [-u <key-id>] [--prefix <tag prefix>] [[--] <hook arguments...>]

Description

Commits changes with message "Release <tagname>" or custom commit information, tags with the given <tagname> and pushes the branch / tags.

This command always creates a release commit, which could be empty if nothing changed. It works like git merge --no-ff. If you don´t like the behavior, you could add --no-empty-commit to skip it.

Optionally it generates a changelog (see git-changelog) and a remote can be defined. The order of first -c or -r does not matter.

If .git/hook/pre-release or .git/hook/post-release exist, they will be triggered with tagname and extra hook arguments before/after the release.

Options

--semver <name>
If the latest tag in your repo matches the semver format requirement, you could increase part of it as the new release tag with this option. The name must be one of the major, minor, patch. For example, assumed the latest tag is 4.4.0, with git release --semver minor you will make a new release with tag 4.5.0. Use --prefix if tag has a character before semver.

<tagname>

The name of the newly created tag. Also used in tag comment.

--prefix <tag prefix>
Use a prefix with a semver tag. git release --semver minor --prefix r would increment the latest tag r4.4.0 to r4.5.0. This prefix can be any length, without spaces.
-r <remote>
The "remote" repository that is destination of a push operation: it is passed to git push.
-m <commit info>
use the custom commit information instead of the default message "Release <tagname>" .
--no-empty-commit
Avoid creating empty commit if nothing could be committed.
-c
Generates or populates the changelog with all commit message since the last tag. For more info see git-changelog..
-s
Create a signed and annotated tag.
-u <key-id>
Create a tag, annotated and signed with the given key.

[--] hook arguments...

The arguments listed after "--" separator will be passed to pre/post-release hook following the tagname.

Examples

Author

Written by Tj Holowaychuk <tj@vision-media.ca> Extended by David Hartmann <dh@tsl.io>

Reporting Bugs

<https://github.com/tj/git-extras/issues>

See Also

<https://github.com/tj/git-extras>

Referenced By

git-extras(1).

April 2022 Git Extras