Git
Bitbucket
Git Tags
Version Control
Git Tutorial

How can I add Git tags in Bitbucket?

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

Introduction

Git tags are how you mark important points in repository history, most commonly releases such as v1.2.0. Bitbucket displays tags, but the underlying operation is still plain Git. In practice, you usually create tags locally and push them to the Bitbucket remote.

Understand Lightweight and Annotated Tags

Git supports two main tag types:

  • Lightweight tags are just references to a commit.
  • Annotated tags store metadata such as tagger, date, and message.

For release management, annotated tags are the safer default because they preserve context.

Create a lightweight tag:

bash
git tag v1.2.0

Create an annotated tag:

bash
git tag -a v1.2.0 -m "Release 1.2.0"

Most teams should prefer the annotated form.

Tag the Correct Commit

Before tagging, confirm which commit you want to mark.

bash
git log --oneline --decorate -5

If you want to tag the current HEAD, create the tag directly. If you want an older commit, pass the hash:

bash
git tag -a v1.2.0 8f1c2ab -m "Release 1.2.0"

This matters because tags are immutable markers by convention. Moving a published tag later is possible, but it creates confusion.

Push the Tag to Bitbucket

Creating a tag locally is not enough. Push it to the Bitbucket remote:

bash
git push origin v1.2.0

If you created several tags and want to push them all:

bash
git push origin --tags

Pushing one explicit tag is usually safer than pushing every local tag blindly.

Verify the Tag Locally and Remotely

Check the tag metadata locally:

bash
git show v1.2.0

You can also list tags:

bash
git tag

Once pushed, Bitbucket should show the tag under repository tags or refs, depending on UI layout. Even if the UI is slow to update, the remote Git ref is the real source of truth.

Use Tags for Releases and Deployments

Tags are useful for:

  • Release versions.
  • Deployment markers.
  • Milestone snapshots.
  • Linking builds to source history.

For example, CI can build directly from a tag:

bash
git checkout v1.2.0

That makes it easier to reproduce exactly what was released.

Delete or Move a Tag Carefully

If a wrong tag is created and not yet widely used, you can delete it locally and remotely.

Delete local tag:

bash
git tag -d v1.2.0

Delete remote tag:

bash
git push origin :refs/tags/v1.2.0

If the tag was already used by CI, deployments, or other developers, changing it can break traceability. It is often better to create a corrected new tag instead.

Tagging from Bitbucket UI

Some Bitbucket editions expose UI actions for creating tags. That can be convenient for small workflows, but the Git command-line approach is still the most explicit and portable. It also fits normal release scripts and automation better than a manual web action.

If your team uses automation, prefer tagging in Git and pushing to Bitbucket rather than relying on UI-only steps.

Best Practices for Tag Naming

Pick one convention and keep it stable. Common patterns:

  • 'v1.2.0'
  • 'release-2026-03-07'
  • 'prod-2026-03-07-01'

Stable naming helps CI, release notes, and dashboards stay predictable.

Common Pitfalls

  • Creating a tag locally and forgetting to push it to Bitbucket.
  • Using lightweight tags for releases when annotated tags would be clearer.
  • Tagging the wrong commit because history was not checked first.
  • Reusing or moving published tags and breaking reproducibility.
  • Pushing all local tags when only one new release tag should be published.

Summary

  • Bitbucket tags are standard Git tags stored on the remote.
  • Create tags locally with git tag, preferably using annotated tags for releases.
  • Push tags explicitly with git push origin TAG_NAME.
  • Verify the target commit before tagging because tags are meant to be stable markers.
  • Treat published tags as immutable for clean release history.

Related reading
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions