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 inworkbench/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
--forceor shorthand-fcommand option. In most cases this is a very bad idea! - stash and unstash your changes using
--stashor-scommand 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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hyn/git-helpers 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A fork of runcmf/runtracy
Easily manage git hooks in your composer config
PHP Terminal emulator controller utilizing ANSI escape sequence coding.
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
Nagios plugin to verify a git repository.
a package for collections of custom toolkit
统计信息
- 总下载量: 42
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-11