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

git-sw

v1.0.0

Published

Git branch switch with remarks - 为Git分支添加备注并交互式切换

Downloads

9

Readme

git-sw

Git分支切换工具 - 为分支添加备注并交互式切换

npm version License: MIT

✨ 功能特点

  • 🏷️ 分支备注 - 为任意分支添加描述性备注
  • 🔄 交互式切换 - 带备注显示的分支选择界面
  • 🔍 快速搜索 - 通过关键词搜索分支备注
  • 💾 按项目存储 - 每个项目独立的备注配置
  • 🌍 跨平台 - 支持 macOS、Linux、Windows

📦 安装

npm install -g git-sw

🚀 使用

交互式切换分支(默认)

git-sw

显示所有本地分支及备注,使用上下键选择后回车切换:

? 选择分支:
* main       生产环境
  dev        测试环境
  feature/x  新功能开发

添加分支备注

# 为指定分支添加备注
git-sw add main "生产环境分支"
git-sw add feature/login "登录功能开发"

# 为当前分支添加备注
git-sw add "当前功能说明"

显示分支备注

# 显示指定分支备注
git-sw show main

# 显示当前分支备注
git-sw show

列出所有分支

git-sw list
# 或
git-sw ls

输出示例:

* main       生产环境
  dev        测试环境
  feature/x  无备注

搜索备注

git-sw search 生产

删除备注

git-sw remove feature/old
# 或
git-sw rm feature/old

📁 数据存储

备注数据存储在每个项目的根目录下:

<项目根目录>/.git-branch-notes.json

这样设计的好处:

  • ✅ 不同项目的备注完全隔离
  • ✅ 可以选择提交到仓库与团队共享
  • ✅ 也可以加入 .gitignore 保持私有

格式示例:

{
  "main": "生产环境",
  "dev": "测试环境",
  "feature/login": "登录功能开发"
}

🔧 命令参考

| 命令 | 说明 | | ------------------------------ | ------------------ | | git-sw | 交互式切换分支 | | git-sw add <branch> <remark> | 添加分支备注 | | git-sw add <remark> | 为当前分支添加备注 | | git-sw show [branch] | 显示分支备注 | | git-sw list | 列出所有分支及备注 | | git-sw search <keyword> | 搜索备注 | | git-sw remove <branch> | 删除分支备注 | | git-sw -h | 显示帮助 | | git-sw -v | 显示版本 |

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 License

MIT