Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+4 votes
2 views
in DevOps and Agile by (29.3k points)
edited by

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/yeshu4/website.

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

3 Answers

+3 votes
by (50.2k points)

There are two ways to create a tag 

From command line

Github’s interface

Let’s see how it can be done

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

git tag <tagname>

To describe your 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

if you just want to push a single tag:

git push origin <tag>

Then it will be pushed to the Github using the above commands.

Refer: https://git-scm.com/docs/git-push

Creating tags using Github’s interface.

1. Click on release on your repository

image

2. Create a new release

image

3. Give your tag here

image
4. Then publish those release
imageThus you can create a tag from the github interface.
0 votes
by (37.3k points)

Creating a Tag in the GitHub Repository: 

Step 1: Go to the GitHub repository where you want to make changes

Step 2: Go to the Releases section

Step 3: Click on Create a new release

Step 4: Click on the dropdown menu in the Choose a Tag section and add the tag that you want to add.

Step 5: Choose the branch whose code you want to be taken for adding the tag.

Step 6: Write the Release title that you desire and add the description if you want.

Step 7: Click on the Publish release button present at the left bottom to publish your tag.

Step 8: Now on your repository page, you can see your desired tag under the Tags section.

0 votes
by (1.8k points)

When you set up a tag in your own local Git repository, it does not mean that it is automatically pushed to GitHub. Tags must be pushed explicitly. Here’s how you can do this:

Suppose you want to push a certain tag, say 2.0, for example, to the GitHub repository, then run the command below:

git push origin 2.0


If you want to do it in a different way by pushing all of the available tags that you have created in your local repository to the remote one on GitHub, do as follows:

git push origin –-tags

In order to view the tag in GitHub: After the push, open your repository on GitHub and click Releases or Tags (for example, https://github.com/yeshu4/website/tags) to find the tag.

After you have successfully pushed the tag, you should see it on GitHub.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...