git-remote add [options] <name> <url>

@param string $name    remote name
@param string $url     URL of remote
@param array  $options options for the add subcommand

@throws \RuntimeException
@return string
183986
public function add($name, $url, $options = array())
    {
        $subcmd = new AddSubCommand();
        $subcmd->prepare($name, $url, $options);

        return $this->remote($subcmd);
    }
346840
public function addRunner($name, WorkerRunnerInterface $runner, array $options = array())
    {
        $this->runners[$name] = array(
            'runner' => $runner,
            'options' => $options,
        );
    }
944522
public function showCommand($url = 'git@github.com:achimfritz/championship-distribution.git')
    {
        $repository = $this->driverComposite->getRepository($url);
        $this->outputLine('repositoryUrl: ' . $repository->getRepositoryUrl());
        $this->outputLine('name: ' . $repository->getName());
        $this->outputLine('webUrl: ' . $repository->getWebUrl());
        $this->outputLine('branches');
        $branches = $repository->getBranches();
        if (count($branches) === 0) {
            $this->outputLine('no branches found');
        } else {
            foreach ($branches as $branch) {
                $commit = $branch->getCommit();
                $this->outputLine($branch->getName() . ' ' . $commit->getId() . ' ' . $commit->getMessage() . ' ' . $commit->getCommitterName() . ' ' . $commit->getDate());
            }
        }
        $this->outputLine('tags');
        $tags = $repository->getTags();
        if (count($tags) === 0) {
            $this->outputLine('no tags found');
        } else {
            foreach ($tags as $tag) {
                $commit = $tag->getCommit();
                $this->outputLine($tag->getName() . ' ' . $commit->getId() . ' ' . $commit->getMessage() . ' ' . $commit->getCommitterName() . ' ' . $commit->getDate());
            }
        }
    }
1373504
public function handle($path, $remoteUrl, $name, array $options = [])
    {
        //Get file from remote url
        $contents = (new \GuzzleHttp\Client(['verify' => false]))
            ->request('get', $remoteUrl)
            ->getBody()
            ->getContents();

        $path = trim($path.'/'.$name, '/');

        return $this->filesystem->put($path, $contents, $options) ? $path : false;
    }
299230
public static function image($url, $name = null, $options = [])
    {
        $options['src'] = $url;

        self::exclure($options);

        return self::input('image', $name, null, $options);
    }
761825
def _set_remote(self, name, url):
        
        remotes = self._get_remotes()
        exising_url = remotes.get(name)
        if exising_url == url:
            logger.info('Remote already exists %s <%s>', name, url)
            return
        if not exising_url:
            logger.info('Adding remote %s <%s>', name, url)
            self.log_call(['git', 'remote', 'add', name, url], cwd=self.cwd)
        else:
            logger.info('Remote remote %s <%s> -> <%s>',
                        name, exising_url, url)
            self.log_call(['git', 'remote', 'rm', name], cwd=self.cwd)
            self.log_call(['git', 'remote', 'add', name, url], cwd=self.cwd)
276017
public function addBranch($name, array $commands, $path = null, array $options = array())
    {
        $path = $path ? $path : $this->path;

        if (!array_key_exists($name, $this->branchesList)) {
            $this->logger->info('Add branch '.$name.', path: '.$path);

            $branch = new Branch($this, $name, $path, $options, $this->options);
            $branch->addCommand($commands);
            $this->branchesList[$name] = $branch;
        }

        return $this;
    }
716875
public function createCustomAPI($url, $name)
    {
        $api = new Custom($url, $name);
        if (!$this->getHttpClient()) {
            $this->setHttpClient();
        }
        if (!$this->getEntityFactory()) {
            $this->setEntityFactory();
        }
        return $api->registerDiffbot($this);
    }
598539
public function createPathBuilder($name, array $options = []) {
		$className = App::className($name, 'Storage/PathBuilder', 'PathBuilder');
		if (!class_exists($className)) {
			$className = App::className('Burzum/FileStorage.' . $name, 'Storage/PathBuilder', 'PathBuilder');
		}

		if (!class_exists($className)) {
			throw new RuntimeException(sprintf('Could not find path builder "%s"!', $name));
		}

		$pathBuilder = new $className($options);
		if (!$pathBuilder instanceof PathBuilderInterface) {
			throw new RuntimeException(sprintf('Path builder class "%s" does not implement the PathBuilderInterface interface!', $name));
		}

		return $this->_pathBuilder = $pathBuilder;
	}
1120793
public function addInstallMap($name, $url)
    {
        $mapElement = new InstallMap($name, $url);
        return $this->addElement($mapElement);
    }
218872
private function addLongOption($name, $value)
    {
        if (!$this->definition->hasOption($name)) {
            throw new \RuntimeException(\sprintf('The "--%s" option does not exist.', $name));
        }

        $option = $this->definition->getOption($name);

        if (null !== $value && !$option->acceptValue()) {
            throw new \RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name));
        }

        if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) {
            // if option accepts an optional or mandatory argument
            // let's see if there is one provided
            $next = \array_shift($this->parsed);
            $nextToken = $next[0];
            if ((isset($nextToken[0]) && '-' !== $nextToken[0]) || \in_array($nextToken, ['', null], true)) {
                $value = $nextToken;
            } else {
                \array_unshift($this->parsed, $next);
            }
        }

        if (null === $value) {
            if ($option->isValueRequired()) {
                throw new \RuntimeException(\sprintf('The "--%s" option requires a value.', $name));
            }

            if (!$option->isArray() && !$option->isValueOptional()) {
                $value = true;
            }
        }

        if ($option->isArray()) {
            $this->options[$name][] = $value;
        } else {
            $this->options[$name] = $value;
        }
    }
1281358
public static function addScript(string $name, array $options = [])
    {
        if (! in_array($name, self::getScripts()))
            self::$scripts[] = $name;
        self::setOptions($name, $options);
    }
331371
protected function appendUrlOptions($url, $options)
    {
        $options = array_only($options, [
            'welcome_msg',
            'timezone',
            'anonymous',
            'minimal'
        ]);

        $boolean_keys = ['minimal', 'anonymous'];
        foreach ($boolean_keys as $key) {
            if (isset($options[$key])) {
                $options[$key] = $this->booleanToString($options[$key]);
            } else {
                $options[$key] = 'true';
            }
        }

        return $url . '?' . http_build_query($options);
    }
138514
public function setPushUrl($name, $url, $oldUrl = null)
    {
        $this->arguments[] = 'set-url';
        $this->arguments[] = $name;
        $this->arguments[] = '--push';
        $this->arguments[] = $url;
        if ($oldUrl) {
            $this->arguments[] = $oldUrl;
        }
        return $this;
    }
183686
public function installRepository(string $name, string $type, string $url)
    {
        if (array_key_exists('repositories', $this->definition)
            && array_key_exists($name, $this->definition['repositories'])
        ) {
            return;
        }

        $application = new Application();
        $command     = new ConfigCommand();

        $definition = clone $application->getDefinition();
        $definition->addArguments($command->getDefinition()->getArguments());
        $definition->addOptions($command->getDefinition()->getOptions());

        $input = new ArrayInput(
            [
                'command' => 'config',
                'setting-key' => 'repositories.' . $name,
                'setting-value' => [
                    $type,
                    $url
                ],
                '--working-dir' => $this->workingDir
            ],
            $definition
        );

        $application->setAutoExit(false);
        $application->run($input, $this->output);
    }
653324
public static function add($name, array $options) 
		{

			// Already known?
			if (array_key_exists($name, self::$_auths)) {
				throw new \Exception("There is already a Auth defined for '$name'.", 1);				
			}

			// Create it
			$auth = new Auth($name, $options);
			self::$_auths[$name] = $auth;
			return $auth;

		}
262137
public function handle($path, $remoteUrl, array $options = [])
    {
        //Get file from remote url
        $contents = $this->filesystem
            ->getAdapter()
            ->getHttpClient()
            ->get($remoteUrl)
            ->getBody()
            ->getContents();

        $filename = md5($contents);
        $extension = ExtensionGuesser::getInstance()->guess(MimeType::detectByContent($contents));
        $name = $filename.'.'.$extension;

        $path = trim($path.'/'.$name, '/');

        return $this->filesystem->put($path, $contents, $options) ? $path : false;
    }