contao-community-alliance / vcs-synchronizer
此包已被废弃且不再维护。作者建议使用 bit3/vcs-synchronizer 包代替。
保持多个VCS仓库同步。
dev-develop / 1.0.x-dev
2014-11-11 16:30 UTC
Requires
- php: >=5.4
- contao-community-alliance/build-system-repository-git: ~1.0
- monolog/monolog: ~1.0
- symfony/console: ~2.3
- symfony/event-dispatcher: ~2.3
- symfony/monolog-bridge: ~2.3
Requires (Dev)
- contao-community-alliance/build-system: ~1.0
- contao-community-alliance/coding-standard: ~1.0
- phploc/phploc: ~2.0
- phpmd/phpmd: ~2.0
- phpunit/phpunit: 3.7.*
- sebastian/phpcpd: ~2.0
- squizlabs/php_codesniffer: ~1.0
- symfony/filesystem: ~2.5
- symfony/process: ~2.5
This package is not auto-updated.
Last update: 2019-02-20 18:12:32 UTC
README
 
VCS 同步器
此仓库包含多个同步器,用于同步多个相同类型的VCS仓库。
对称同步与不对称同步
对称同步意味着每个仓库都被比较并与其他仓库同步。如果检测到冲突(两个远程分支分叉),则不会同步相关分支的任何仓库。
不对称同步意味着一个(主仓库)与其他所有仓库进行比较和同步。如果检测到冲突(一个远程分支领先于主仓库),则不会同步相关仓库的分支。
工作仓库
同步器在本地 工作仓库 上工作。但它们不会为您创建它们!这可以让您控制发生了什么。
以下是一个创建本地 工作仓库 的示例。
use ContaoCommunityAlliance\BuildSystem\Repository\GitRepository; $path = tempnam(sys_get_temp_dir()); unlink($path); mkdir($path); $repository = new GitRepository($path); $repository->init()->execute(); $repository->remote()->add('github', 'git@github.com:contao-community-alliance/vcs-synchronizer.git')->execute(); $repository->remote()->add('bitbucket', 'git@bitbucket.org:contao-community-alliance/vcs-synchronizer.git')->execute();
Git 同步器
对称分支同步器
CLI 使用
./bin/git-branches-symmetric-sync -b github -b bitbucket /path/to/repository
PHP 使用
use ContaoCommunityAlliance\BuildSystem\VcsSync\Synchronizer\GitSymmetricBranchSynchronizer; $synchronizer = new GitSymmetricBranchSynchronizer( // the working repository $repository, // the remotes to synchronize ['github', 'bitbucket'] ); $synchronizer->setLogger($logger); $synchronizer->sync();
不对称分支同步器
CLI 使用
./bin/git-branches-asymmetric-sync -b github -b bitbucket -p github /path/to/repository
PHP 使用
use ContaoCommunityAlliance\BuildSystem\VcsSync\Synchronizer\GitAsymmetricBranchSynchronizer; $synchronizer = new GitAsymmetricBranchSynchronizer( // the working repository $repository, // the remotes to synchronize ['github', 'bitbucket'], // the primary remote 'github' ); $synchronizer->setLogger($logger); $synchronizer->sync();
不对称标签同步器
CLI 使用
./bin/git-tags-asymmetric-sync -b github -b bitbucket -p github /path/to/repository
PHP 使用
use ContaoCommunityAlliance\BuildSystem\VcsSync\Synchronizer\GitAsymmetricTagSynchronizer; $synchronizer = new GitAsymmetricTagSynchronizer( // the working repository $repository, // the remotes to synchronize ['github', 'bitbucket'], // the primary remote 'github' ); $synchronizer->setLogger($logger); $synchronizer->sync();