Create a tag in a GitHub repository

16    Asked by MaryBrunt in Devops , Asked on Jun 25, 2025

How can you create a tag in a GitHub repository to mark specific commits?

This question explains how to create and push tags in Git using the command line or GitHub UI, helping you mark releases, milestones, or important snapshots in your project’s history.

Answered by Lucas Jackson

Tags in Git (and GitHub) are super useful when you want to mark specific points in your project's history—like a stable release or a major update. Creating a tag is like putting a sticky note on a particular commit, so you or others can easily reference it later.

 1. Create a Tag Using Git (Command Line)

Lightweight Tag:

  git tag v1.0

Annotated Tag (recommended):

  git tag -a v1.0 -m "Release version 1.0"

The -a flag creates an annotated tag with metadata like the tagger’s name, date, and a message.

 2. Push Tag to GitHub

By default, tags aren't pushed with git push, so you need to do this:

  git push origin v1.0

Or push all tags:

  git push --tags

 3. Create a Tag via GitHub Web UI

  1. Go to your repository on GitHub.
  2. Click on "Releases" > "Draft a new release".
  3. Enter a tag name (you can create a new one).
  4. Choose the target commit and fill in release notes.
  5. Click "Publish release".

So, whether you prefer the command line or GitHub’s UI, tagging is a great way to manage releases and track progress. It’s especially helpful when working on collaborative projects or using CI/CD pipelines.



Your Answer

Interviews

Parent Categories