Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. How to use Git
  6. How to use tagging in Git
  7. Add a tag
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

Add a tag

Use the git tag command to add a new tag named tag1.

$ git tag tag1

Then, run the tag command without any parameters, and you’ll see a list of tags in this repository, including the one we just added.

$ git tag
  tag1

To see the history log with tag information, execute the git log command with the --decorate option.

$ git log --decorate
  commit e7978c94d2104e3e0e6e4a5b4a8467b1d2a2ba19 (HEAD, tag: tag1, main)
  Author: yourname <yourname@yourmail.com>
  Date:   Wed Jul 18 16:43:27 2022 +0900

      first commit

This is how our history looks now.

Add a tag "tag1" to the commit indicated by the current HEAD

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life