Skip to content
Fix Code Error

Create a tag in a GitHub repository

March 13, 2021 by Code Error
Posted By: Anonymous

I have a repository in GitHub and I need to tag it.
I tagged in a shell, but on GitHub, it is not showing up.

Do I have to do anything else?

The command I used in the shell is:

git tag 2.0

And now when I type git tag it shows:

2.0

So it seems like tags are present, correct?

The repository is: https://github.com/keevitaja/myseo-pyrocms.

How do I make this tag show up on GitHub? Where are my tags?

Solution

You can create tags for GitHub by either using:

  • the Git command line, or
  • GitHub’s web interface.

Creating tags from the command line

To create a tag on your current branch, run this:

git tag <tagname>

If you want to include a description with your tag, add -a to create an annotated tag:

git tag <tagname> -a

This will create a local tag with the current state of the branch you are on. When pushing to your remote repo, tags are NOT included by default. You will need to explicitly say that you want to push your tags to your remote repo:

git push origin --tags

From the official Linux Kernel Git documentation for git push:

--tags

All refs under refs/tags are pushed, in addition to refspecs explicitly listed on the command line.

Or if you just want to push a single tag:

git push origin <tag>

See also my answer to How do you push a tag to a remote repository using Git? for more details about that syntax above.

Creating tags through GitHub’s web interface

You can find GitHub’s instructions for this at their Creating Releases help page. Here is a summary:

  1. Click the releases link on our repository page,

    Screenshot 1

  2. Click on Create a new release or Draft a new release,

    Screenshot 2

  3. Fill out the form fields, then click Publish release at the bottom,

    Screenshot 3
    Screenshot 4

  4. After you create your tag on GitHub, you might want to fetch it into your local repository too:

    git fetch
    

Now next time, you may want to create one more tag within the same release from website. For that follow these steps:

Go to release tab

  1. Click on edit button for the release

  2. Provide name of the new tag ABC_DEF_V_5_3_T_2 and hit tab

  3. After hitting tab, UI will show this message: Excellent! This tag will be created from the target when you publish this release. Also UI will provide an option to select the branch/commit

  4. Select branch or commit

  5. Check “This is a pre-release” checkbox for qa tag and uncheck it if the tag is created for Prod tag.

  6. After that click on “Update Release”

  7. This will create a new Tag within the existing Release.

Answered By: user456814

Related Articles

  • Reference - What does this regex mean?
  • Is CSS Turing complete?
  • How to solve Internal Server Error in Next.Js?
  • enum to string in modern C++11 / C++14 / C++17 and…
  • git pull while not in a git directory
  • What is a "cache-friendly" code?
  • Hexadecimal To Decimal in Shell Script
  • Why do I have to "git push --set-upstream origin "?
  • Checkout another branch when there are uncommitted…
  • Why do git fetch origin and git fetch : behave differently?
  • Git - Pushing code to two remotes
  • Git Using Remote Branch
  • Does "git fetch --tags" include "git fetch"?
  • How do I make a Git commit in the past?
  • How to track untracked content?
  • What is git tag, How to create tags & How to…
  • Tensorflow equivalent to torch.Tensor.index_copy
  • Implementing two interfaces in a class with same…
  • Retrieve specific commit from a remote Git repository
  • What's the difference between HEAD^ and HEAD~ in Git?
  • Why call git branch --unset-upstream to fixup?
  • How can I find the location of origin/master in git,…
  • Retrieve the commit log for a specific line in a file?
  • Compiler error: "class, interface, or enum expected"
  • Git workflow and rebase vs merge questions
  • Implement Stack using Two Queues
  • Neither BindingResult nor plain target object for…
  • How to retrieve a single file from a specific…
  • How to recover stashed uncommitted changes
  • Push git commits & tags simultaneously
  • python 3.2 UnicodeEncodeError: 'charmap' codec can't…
  • Avoid creating new session on each axios request laravel
  • What are the undocumented features and limitations…
  • What is "git remote add ..." and "git push origin master"?
  • “tag already exists in the remote" error after…
  • Various ways to remove local Git changes
  • Multipart File Upload Using Spring Rest Template +…
  • How to pull in changes from skeleton sub-repository…
  • Setting up and using Meld as your git difftool and mergetool
  • Git submodule update
  • Trying to embed newline in a variable in bash
  • git lfs push to github failure on Ubuntu 18.04
  • Is it safe to shallow clone with --depth 1, create…
  • How to fix Git error: object file is empty?
  • What is your most productive shortcut with Vim?
  • Push on GIT and Bitbucket
  • How to get $HOME directory of different user in bash script?
  • In plain English, what does "git reset" do?
  • Examples of GoF Design Patterns in Java's core libraries
  • How to backup a local Git repository?
  • Detach (move) subdirectory into separate Git repository
  • Git push error: "origin does not appear to be a git…
  • Git command to show which specific files are ignored…
  • What's the difference between "git reset" and "git…
  • How can I see the model as visualized?
  • Smart way to truncate long strings
  • Windows git "warning: LF will be replaced by CRLF",…
  • How do I remove a submodule?
  • Is it possible to use pip to install a package from…
  • How to configure Git post commit hook
  • show all tags in git log
  • git status shows modifications, git checkout --…
  • Why does Git say my master branch is "already up to…
  • Recalculate merge conflicts (ie. how to generate…
  • Why is Git better than Subversion?
  • How to list all Git tags?
  • How to permanently set $PATH on Linux/Unix?
  • Error creating bean with name
  • How is a tag different from a branch in Git? Which…
  • Ukkonen's suffix tree algorithm in plain English
  • Web Application Problems (web.config errors) HTTP…
  • Git merge with force overwrite
  • What exactly does the "u" do? "git push -u origin…
  • 'cannot open git-upload-pack' error in Eclipse when…
  • How to upload a project to Github
  • Change a Git remote HEAD to point to something…
  • Trouble Understanding broadcasting behavior for tensors
  • How do I clone a single branch in Git?
  • Is there a way to cache GitHub credentials for…
  • javascript .replace and .trim not working in vuejs
  • Spring 3.0: Unable to locate Spring NamespaceHandler…
  • Requested bean is currently in creation: Is there an…
  • How to git reset --hard a subdirectory?
  • Difference between git checkout --track…
  • Problems with local variable scope. How to solve it?
  • Git: Create a branch from unstaged/uncommitted…
  • How can I switch to another branch in git?
  • ember.js seemingly picking the wrong controller for a route
  • Why does git perform fast-forward merges by default?
  • PHP parse/syntax errors; and how to solve them
  • Interface vs Abstract Class (general OO)
  • How to properly do JSON API GET requests and assign…
  • How to make a great R reproducible example
  • Git's famous "ERROR: Permission to .git denied to user"
  • Implement Interface with custom method and JpaRepository
  • Git push: "fatal 'origin' does not appear to be a…
  • How Spring Security Filter Chain works
  • Interface extends another interface but implements…
  • git push says "everything up-to-date" even though I…
  • Why does git say "Pull is not possible because you…

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

How can I print a circular structure in a JSON-like format?

Next Post:

Open and write data to text file using Bash?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error