Created
July 7, 2010 13:22
-
-
Save co3k/466676 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'VersionControl/Git.php'; | |
$git = new VersionControl_Git('/home/ebihara/OpenPNE2-git-mirror'); | |
$git->setGitCommandPath('/usr/local/bin/git'); | |
$branches = $git->getBranches(); | |
foreach ($branches as $branch) | |
{ | |
$git->checkout($branch); | |
$git->getCommand('svn rebase')->execute(); | |
$git->getCommand('push') | |
->addArgument('origin') | |
->addArgument($branch) | |
->execute(); | |
} | |
$tags = $git->getTags(); | |
$remote_branches = $git->getRemoteBranches('tags'); | |
foreach ($remote_branches as $remote_branch) | |
{ | |
if (false !== strpos($remote_branch, '@')) | |
{ | |
continue; | |
} | |
if (isset($tags[$remote_branch])) | |
{ | |
continue; | |
} | |
$git->checkout('tags/'.$remote_branch); | |
$git->getCommand('tag') | |
->addArgument($remote_branch) | |
->execute(); | |
} | |
$git->getCommand('push') | |
->addArgument('origin') | |
->setOption('tags') | |
->execute(); | |
$git->checkout('master'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment