stikman/php-git-version-tool 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

stikman/php-git-version-tool

Composer 安装命令:

composer require stikman/php-git-version-tool

包简介

Class that makes managing local git repos and syncing with remote repos easy. Good utility class for cli tools that rely on semver tagging for deployment

README 文档

README

This class helps deal with remote repos and local repos you want to sync up. It handles tagged releases specifically allowing you to push up tagged version releases to a central repository. In my case I built it because I had a centralized shared private repo of code that multiple other engineers would need to push their tagged version of code into.

####Enjoy! I hope it helps others out!

Note: The server running commands will need to have git ssh permissions or use the credentials in the path to make the http request. If you are having issues post an issue and I will try to help.

Override location of git binary (it assumes the binary /usr/bin/git)

$git = new GitWrapper(); 
$git->setGit('/usr/local/bin/git'); 

Add a remote directory to contain new code

$git = new GitWrapper();
$git->add("/local/instance/of/package/registry",{$module->name}/{$module->version}/");
$git->commitAndPush(
    "/local/instance/of/package/registry",  // local instance of shared registry
    "{$module->name}/{$module->version}/",   // make changes and push to remote 
    "{$module->name} was registered systematically" // message for commit 
);

Fetch a specific version of a remote repo and clone it somewhere local More specific version of how to use wrapper

function getVersion($path, $remoteUrl, $version = 'master') {        
    $git = new GitWrapper();
    $git->cloneRemoteNoCheckout($path, $remoteUrl);

    if($version !== 'master ) {
       $ref = $git->getTagRef($path, $version);
    } 

    $git->checkoutRef($path, $ref);
}

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固