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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@johnhom/mg-cli

v3.1.0

Published

CLI to auto merge branch to target branch which is provided

Downloads

2

Readme

mg-cli

🚀 (Auto) Merge CLI

Auto Merge CLI 是一个功能强大的命令行工具,旨在帮助开发者自动拉取代码、合并分支、推送远程等等操作。

它提供了一种简单而高效的方式,通过shelljs库调用Node.js API,实现在shell中执行git相关的操作,无需人工一步步去操作git进行分支的切换和合并,以提高工作的效率。

👀 使用示例

背景:假设你完成了功能分支feature/a的开发,想要合并到测试分支dev,并且推到远程。

一般我们的操作步骤是:

# 切换到 dev 分支
git checkout dev

# 下拉 dev 分支的远程代码
git pull

# 合并功能分支 feature/a 到 dev
git merge feature/a

# 推送 dev 分支到远程仓库
git push

以下是使用Auto Merge CLI的简单示例命令:

# 处于 feature/a 分支中
amg dev

上述会按顺序进行如下操作:

  1. 在当前分支执行git pull
  2. 获取当前分支的名称
  3. 切换到目标分支dev
  4. 执行git pull
  5. 合并分支
  6. 询问是否要推到远程
  7. 询问是否要切回源分支

使用的示例图片如下:

⌛️ 安装

全局安装

npm install -g @johnhom/mg-cli

# 或者
# yarn global add @johnhom/mg-cli

💡 具体用法

Usage:
  $ amg [target_branch]

Commands:
  [target_branch]  merge current branch into target_branch

For more info, run any command with the `--help` flag:
  $ amg --help

Options:
  -h, --help     Display this message 
  -v, --version  Display version number 

Examples:
amg master    把当前分支自动合并到master

假设你当前项目所在的分支为:feature/a,你想要把这个分支合并到dev,并自动上传到远程仓库,你只需要执行以下命令:

amg dev

⏳ 调试方式

使用pnpm link对当前项目链接到电脑的全局环境上,如果是在项目的根目录,则执行以下命令:

注意:如果你的电脑已全局安装@johnhom/mg-cli,则需要先删除全局包,再link

pnpm link --global --dir=./packages/mg-cli