protected function splitTree($subtree, $namespace)
    {
        $this->out()->out(sprintf('@ Start subtree split (%s)', $subtree))
            ->out('---------------------------------------');

        // Do split
        $this->exec(sprintf('git branch -D sub-%s', $subtree));
        $this->exec('git subtree split -P src/' . $namespace . ' -b sub-' . $subtree);

        // Create a new branch
        $this->exec(sprintf('git branch -D %s-%s', $this->branch, $subtree));

        // Add remote repo
        $this->exec(
            sprintf(
                'git remote add %s git@github.com:%s/windwalker-%s.git', $subtree, $this->organization,
                $subtree
            )
        );

        $force = $this->io->getOption('f') ?: $this->io->getOption('force', false);

        $force = $force ? ' -f' : false;

        if (!$force) {
            $this->exec(sprintf('git fetch %s', $subtree));

            $this->exec(
                sprintf(
                    'git checkout -b %s-%s --track %s/%s', $this->branch, $subtree, $subtree,
                    $this->branch
                )
            );

            $this->exec(sprintf('git merge sub-%s', $subtree));
        }

        $this->exec(sprintf('git push %s sub-%s:%s ' . $force, $subtree, $subtree, $this->branch));

        if ($this->tag) {
            $this->exec('git checkout sub-' . $subtree);

            $this->exec(sprintf('git tag -d %s', $this->tag));

            $this->exec(sprintf('git push %s :refs/tags/%s', $subtree, $this->tag));

            $this->exec(sprintf('git tag %s', $this->tag));

            $this->exec(sprintf('git push %s %s', $subtree, $this->tag));
        }

        $this->exec('git checkout ' . $this->branch);
    }
protected function splitTree($subtree, $namespace)
    {
        $this->out()->out(sprintf('@ Start subtree split (%s)', $subtree))
            ->out('---------------------------------------');

        // Do split
        $this->exec(sprintf('git branch -D sub-%s', $subtree));
        $this->exec('git subtree split -P src/' . $namespace . ' -b sub-' . $subtree);

        // Create a new branch
        $this->exec(sprintf('git branch -D %s-%s', $this->branch, $subtree));

        // Add remote repo
        $this->exec(
            sprintf(
                'git remote add %s git@github.com:%s/windwalker-%s.git', $subtree, $this->organization,
                $subtree
            )
        );

        $force = $this->io->getOption('f') ?: $this->io->getOption('force', false);

        $force = $force ? ' -f' : false;

        if (!$force) {
            $this->exec(sprintf('git fetch %s', $subtree));

            $this->exec(
                sprintf(
                    'git checkout -b %s-%s --track %s/%s', $this->branch, $subtree, $subtree,
                    $this->branch
                )
            );

            $this->exec(sprintf('git merge sub-%s', $subtree));
        }

        $this->exec(sprintf('git push %s sub-%s:%s ' . $force, $subtree, $subtree, $this->branch));

        if ($this->tag) {
            $this->exec('git checkout sub-' . $subtree);

            $this->exec(sprintf('git tag -d %s', $this->tag));

            $this->exec(sprintf('git push %s :refs/tags/%s', $subtree, $this->tag));

            $this->exec(sprintf('git tag %s', $this->tag));

            $this->exec(sprintf('git push %s %s', $subtree, $this->tag));
        }

        $this->exec('git checkout ' . $this->branch);
    }
protected function splitTree ( $ subtree , $ namespace ) { $ this -> out ( ) -> out ( sprintf ( '@ Start subtree split (%s)' , $ subtree ) ) -> out ( '---------------------------------------' ) ; // Do split $ this -> exec ( sprintf ( 'git branch -D sub-%s' , $ subtree ) ) ; $ this -> exec ( 'git subtree split -P src/' . $ namespace . ' -b sub-' . $ subtree ) ; // Create a new branch $ this -> exec ( sprintf ( 'git branch -D %s-%s' , $ this -> branch , $ subtree ) ) ; // Add remote repo $ this -> exec ( sprintf ( 'git remote add %s git@github.com:%s/windwalker-%s.git' , $ subtree , $ this -> organization , $ subtree ) ) ; $ force = $ this -> io -> getOption ( 'f' ) ? : $ this -> io -> getOption ( 'force' , false ) ; $ force = $ force ? ' -f' : false ; if ( ! $ force ) { $ this -> exec ( sprintf ( 'git fetch %s' , $ subtree ) ) ; $ this -> exec ( sprintf ( 'git checkout -b %s-%s --track %s/%s' , $ this -> branch , $ subtree , $ subtree , $ this -> branch ) ) ; $ this -> exec ( sprintf ( 'git merge sub-%s' , $ subtree ) ) ; } $ this -> exec ( sprintf ( 'git push %s sub-%s:%s ' . $ force , $ subtree , $ subtree , $ this -> branch ) ) ; if ( $ this -> tag ) { $ this -> exec ( 'git checkout sub-' . $ subtree ) ; $ this -> exec ( sprintf ( 'git tag -d %s' , $ this -> tag ) ) ; $ this -> exec ( sprintf ( 'git push %s :refs/tags/%s' , $ subtree , $ this -> tag ) ) ; $ this -> exec ( sprintf ( 'git tag %s' , $ this -> tag ) ) ; $ this -> exec ( sprintf ( 'git push %s %s' , $ subtree , $ this -> tag ) ) ; } $ this -> exec ( 'git checkout ' . $ this -> branch ) ; }
Split Git subTree.

@param string $subtree
@param string $namespace

@return  void
Split Git subTree .