npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@joemuhuang/gtt

v1.1.2

Published

A CLI tool to create and push git tags with a standardized format.

Readme

gtt CLI

A powerful and flexible CLI tool to create and push Git tags with a standardized format. Ensure your project versioning is consistent and automated.

🚀 Features

  • Standardized Tagging: Automatically generates tags like v_202403211200_test.
  • Smart Branch Selection: Interactive search for remote branches with last update time display, automatic merge detection.
  • Tag Location Choice: When branch is merged, choose to create tag on source branch or target branch (using merge commit).
  • Tag Messages: Support for annotated tags with comments/messages.
  • Custom Suffixes: Support for custom suffix or no-suffix mode, with option to save to configuration.
  • Highly Configurable: Customize tag formats, datetime formats, and available suffixes.
  • Git Integration: Built on top of simple-git for reliable performance.

📋 Prerequisites

  • Node.js (v16.0.0 or higher recommended)
  • Git installed and configured in your shell.

⚙️ Installation

Option 1: Install from npm (Recommended)

npm install -g @joemuhuang/gtt

Option 2: Build from source

  1. Clone the repository:

    git clone https://github.com/huangxingx/git-time-tag.git
    cd git-time-tag
  2. Install dependencies:

    npm install
  3. Link globally:

    npm link

    Now you can run gtt from any directory.

📖 Usage

Run the command in any Git repository:

gtt

Interactive Flow

  1. Fetch Remote Branches: Automatically runs git fetch --prune to get latest remote branches and clean up stale references.
  2. Select Remote Branch: Choose from available remote branches with search functionality, displaying last update time for each branch.
  3. Choose Tag Location (if applicable): If the selected branch has been merged into main/master/develop, you'll be prompted to choose where to create the tag:
    • On the source branch (the branch you selected)
    • On the merged branch (e.g., main) - uses the merge commit
  4. Select Suffix: Choose from configured suffixes, or select:
    • 📝 Custom - Enter any custom suffix
    • None - Create tag without suffix
  5. Enter Message: Add an optional comment/message for the tag (creates annotated tag).
  6. Push Confirmation: Confirm if you want to push the tag to origin.
  7. Final Review: A preview of the tag name and message is shown for final confirmation.
  8. Save Configuration (if applicable): If custom suffix was used, choose to save to local project or global user configuration.

Command Line Options

gtt                              # Interactive tag creation
gtt -h                           # Display help information
gtt --help                       # Display help information
gtt -m "Release version 1.0.0"   # Create tag with message
gtt --message "Hotfix deploy"    # Create tag with message
gtt -b main                      # Specify remote branch (automatically adds origin/ prefix)
gtt -b origin/feature-x          # Specify remote branch
gtt -b origin/feature-x -m "RC1" # Tag remote branch with message

🛠️ Configuration

You can customize gtt by creating a .gitimetagrc file in your home directory (global) or project root (local). Local settings override global ones.

Configuration File Locations

  • Windows: C:\Users\<YourUsername>\.gitimetagrc
  • macOS/Linux: ~/.gitimetagrc
  • Project: <project-root>/.gitimetagrc

Example .gitimetagrc

{
  "tagFormat": "v_{datetime}_{suffix}",
  "datetimeFormat": "yyyyMMddHHmm",
  "suffixes": ["alpha", "beta", "stable"]
}

| Option | Description | Default | | :--- | :--- | :--- | | tagFormat | The template for the tag. Supports {datetime} and {suffix} placeholders. | v_{datetime}_{suffix} | | datetimeFormat | date-fns format string. | yyyyMMddHHmm | | suffixes | An array of options for the suffix prompt. | ["test", "main"] |

Configuration Options Details

  • tagFormat: Supports two placeholders: {datetime} and {suffix}, which will be replaced with datetime string and suffix respectively.
  • datetimeFormat: Uses date-fns format syntax, supports any date format pattern.
  • suffixes: Each string in the array becomes an option in the interactive selection.

📄 License

MIT

🔗 Links

❓ Troubleshooting

  • "Not a git repository": Ensure you are running gtt inside a directory initialized with Git.
  • "Tag already exists": Git will throw an error if you try to create a tag that already exists. Check your current tags with git tag.
  • "Permission denied" (npm link): On macOS/Linux, you might need sudo npm link. On Windows, run your terminal as Administrator.
  • "Authentication failed": Authentication error when pushing tag, please check your Git remote repository credentials.
  • "Branch does not exist on remote": The remote branch specified with -b option does not exist, please check the branch name.