Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a github release with an annotated tag?

Tags:

I've created a release on github, but it seems to be a non-annotated tag. Anyone know how to make an annotated tag along with a release? Is it OK to just replace the tag with an annotated one -- will it still work?

like image 392
Karol Avatar asked Feb 10 '14 23:02

Karol


People also ask

How do I create an annotated tag in Git?

In order to create a Git tag for the last commit of your current checked out branch, use the “git tag” command with the tag name and specify “HEAD” as the commit to create the tag from. Similarly, if you want your tag to be annotated, you can still use the “-a” and “-m” options to annotate your tag.

What is an annotated Git tag?

Annotated Tags An annotated tag creates an additional tag object in the Git repository, which allows you to store information associated with the tag itself. This may include release notes, the meta-information about the release, and optionally a signature to verify the authenticity of the commit to which it points.

Which command is used to create an annotated tag?

Annotated Tags: To create an annotated tag in Git you can just run the following simple commands on your terminal. The -m denotes message for that particular tag.


1 Answers

Annotated tags are created using the -a flag.

The difference between regular tag to annotated tag is that the annotated tag is like a commit, it contain the date, author and the message attached to it.

Once you create the tags simply push it to the github repository
git push --tags. Since tags are simply a pointer to a given commit you can "move" them between commit.

Creating annotated tag

git tag -a <tagname>

Moving an existing tag

git tag -a <tagname> <SHA-1> -f

Pushing the tags

git push origin --tags -f

The important thing is the -f (force) flag

like image 187
CodeWizard Avatar answered Nov 01 '22 08:11

CodeWizard