定制 hyn/git-helpers 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hyn/git-helpers

Composer 安装命令:

composer require hyn/git-helpers

包简介

Easy helper tool for managing several Git repositories at once.

README 文档

README

This package is meant to be used in your terminal. And allows working with lots of subdirectories containing git repositories.

Installation

composer global require hyn/git-helpers

Make sure to place the ~/.composer/vendor/bin directory in your PATH so the gh executable can be located by your system.

Usage

You can now globally use the command gh, eg:

gh status

Use cases

This package is especially helpful in case you manage your development packages with a repository path configuration in composer.

If you create a workbench directory containing all your development packages. You can set your composer file to point to these packages:

{
    "require": {
        "vendor/package": "*@dev"
    },
    "repositories": [
        {
            "type": "path",
            "url": "workbench/*/"
        }
    ]
}

The above will symlink your development packages from workbench to the vendor folder automatically.

Please note in the above repositories path configuration packages are expected immediately in the workbench directory, eg: workbench/package. A composer.json file should exist in workbench/package/composer.json.

gh status

Now you can use the gh status command in the folder workbench to check the status of your git remote and local changes immediately.

The following is taken into account:

  • A title consisting of:
    • The name of the package (in case of a json file).
    • The latest version (based on the latest tag).
  • Open changes (uncommitted, new etc).
  • Number of commits since last tag.
  • Number of commits not pushed.

gh pull

The command gh pull allows you to mass pull all subdirectories to get you the latest changes.

You can use the optional argument to match subdirectories against a certain (regular expression) match; eg:

gh pull ^feature-

To pull only directories starting with feature-.

Please note this command will not pull changes from the remotes if uncommitted changes have been detected. Unless you:

  • force pulling using the --force or shorthand -f command option. In most cases this is a very bad idea!
  • stash and unstash your changes using --stash or -s command option.

gh tag

The command gh tag can be used to add new tags to your repositories. When commits are detected since the latest tag, you'll be asked to provide a new tag. You can also skip by leaving the input empty.

As with the pull command, you can use the optional argument to match only specific directories.

With the option --up you can specify what part of the previous version you'd like to see in the suggested input, choose between major, minor or patch.

gh changelog

With the gh changelog command you are able to generate changelogs between versions quite easily. Please do understand this is a simple parsed commit history between two versions.

The command will loop through all your repositories, find all tags and will auto generate a diff log file in a specified sub folder (use --path option to override the default value "changelogs"). Please note any existing files will be removed before writing into them!

As with some of the other commands you can use the argument to filter the directories and use -f to force creating changelogs if you have open changes in the directory.

gh commit

The gh commit command allows you to commit similar changes across all repositories. A commit message may be specified using the -m command.

As with other commands, you can use the optional argument to match only specific directories.

gh push

The gh push command pushes the current branch in all repositories to the remote.

As with other commands, you can use the optional argument to match only specific directories.

hyn/git-helpers 适用场景与选型建议

hyn/git-helpers 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 42 次下载、GitHub Stars 达 9, 最近一次更新时间为 2016 年 02 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「git」 「terminal」 「packages」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 hyn/git-helpers 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hyn/git-helpers 我们能提供哪些服务?
定制开发 / 二次开发

基于 hyn/git-helpers 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 42
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-11