Add remote to the repository. It's equivalent to the command
        git remote add <name> <url>

        If the remote already exists with an other url, it's removed
        and added aggain
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)
557979
def remote_url(self, remotename='origin'):
        
        cmd = ['git', 'config', 'remote.%s.url' % remotename]
        return self.sh(cmd, shell=False,
                       ignore_error=True).strip()
66166
protected function addGitRemote($remote_url) {
    $this->say("Fetching from git remote $remote_url");
    // Generate an md5 sum of the remote URL to use as remote name.
    $remote_name = md5($remote_url);
    $this->taskExecStack()
      ->stopOnFail()
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
      ->dir($this->deployDir)
      ->exec("git remote add $remote_name $remote_url")
      ->run();
  }
1101301
public Git cloneRepository(String remoteUrl, Path localPath) {
        try {
            return Git.cloneRepository()
                .setURI(remoteUrl)
                .setDirectory(localPath.toFile())
                .call();
        } catch (GitAPIException e) {
            throw new IllegalStateException(e);
        }
    }
493521
def add_command(self, command):
        
        self._commands.append(command)
        self._build_command_chain(command)
270287
def attach(cls, name, vhost, remote_name):
        """"""
        paas_access = cls.get('paas_access')

        if not paas_access:
            paas_info = cls.info(name)
            paas_access = '%s@%s' \
                          % (paas_info['user'], paas_info['git_server'])

        remote_url = 'ssh+git://%s/%s.git' % (paas_access, vhost)

        ret = cls.execute('git remote add %s %s' % (remote_name, remote_url,))

        if ret:
            cls.echo('Added remote `%s` to your local git repository.'
                     % (remote_name))
            cls.echo('Use `git push %s master` to push your code to the '
                     'instance.' % (remote_name))
            cls.echo('Then `$ gandi deploy` to build and deploy your '
                     'application.')
249318
def add_git(meta, git_info):
        """"""
        meta["hexsha"] = git_info.hexsha
        meta["author"] = git_info.author
        meta["email"] = git_info.email
        meta["authored_on"] = git_info.authored_on.isoformat(" ")
1279051
def push(remote_or_url, *args)
      unless remote_or_url.kind_of? Remote
        remote_or_url = remotes[remote_or_url] || remotes.create_anonymous(remote_or_url)
      end

      remote_or_url.push(*args)
    end
395434
def add_repo(repo, overwrite = false)
      raise ArgumentError, "Repo must be of type Gitolite::Config::Repo!" unless repo.instance_of? Gitolite::Config::Repo
      @repos[repo.name] = repo
    end
202003
private void addRemoteRepoToConfig(GitClient client) throws InterruptedException {
        GitSCM gitScm = getJenkinsScm();
        for (RemoteConfig uc : gitScm.getRepositories()) {
            if (client.getRemoteUrl(uc.getName()) == null)
                client.setRemoteUrl(uc.getName(), uc.getURIs().get(0).toPrivateASCIIString());
        }
    }
395554
@Override
    public void addRemoteRepo(MavenRemoteRepository repository) {
        Builder builder = new Builder(repository.getId(), repository.getType(), repository.getUrl());
        builder.setPolicy(new RepositoryPolicy(true, repository.getUpdatePolicy() == null ? null : repository
                .getUpdatePolicy().apiValue(), repository.getChecksumPolicy() == null ? null : repository
                .getChecksumPolicy().apiValue()));

        for (RemoteRepository r : this.additionalRemoteRepositories) {
            if (r.getId().equals(repository.getId())) {
                this.additionalRemoteRepositories.remove(r);
            }
        }
        this.additionalRemoteRepositories.add(builder.build());
    }
1247631
def _add_parser_arguments_git(self, subparsers):
        
        subparsers.add_parser(
            "git-clone",
            help="Clone all defined data repositories if they dont exist.")

        subparsers.add_parser(
            "git-push",
            help="Add all files to data repositories, commit, and push.")

        subparsers.add_parser(
            "git-pull",
            help="'Pull' all data repositories.")

        subparsers.add_parser(
            "git-reset-local",
            help="Hard reset all data repositories using local 'HEAD'.")

        subparsers.add_parser(
            "git-reset-origin",
            help="Hard reset all data repositories using 'origin/master'.")

        subparsers.add_parser(
            "git-status",
            help="Get the 'git status' of all data repositories.")

        return
248675
def add(self, repo, url):
        
        repo_name = []
        if not url.endswith("/"):
            url = url + "/"
        for line in self.custom_repositories_list.splitlines():
            line = line.lstrip()
            if line and not line.startswith("#"):
                repo_name.append(line.split()[0])
        if (repo in self.meta.repositories or repo in repo_name or
                repo in self.meta.default_repositories):
            print("\nRepository name '{0}' exist, select different name.\n"
                  "View all repositories with command 'slpkg "
                  "repo-list'.\n".format(repo))
            raise SystemExit()
        elif len(repo) > 6:
            print("\nslpkg: Error: Maximum repository name length must be "
                  "six (6) characters\n")
            raise SystemExit()
        with open(self.custom_repo_file, "a") as repos:
            new_line = "  {0}{1}{2}\n".format(repo, " " * (10 - len(repo)), url)
            repos.write(new_line)
        repos.close()
        print("\nRepository '{0}' successfully added\n".format(repo))
        raise SystemExit()
513686
def remote(ctx):
    
    with command():
        m = RepoManager(ctx.obj['agile'])
        click.echo(m.github_repo().repo_path)
938314
def repo_name
      unless @repo_name
        url = config["remote.#{name}.url"]
        raise GitProcessError.new("There is no #{name} url set up.") if url.nil? or url.empty?
        uri = Addressable::URI.parse(url)
        @repo_name = uri.path.sub(/\.git/, '').sub(/^\//, '')
      end
      @repo_name
    end
259102
def remote_for_request(request)
      repo_owner = request.head.repo.owner.login
      remote_url = server.remote_url_for(repo_owner)
      remotes = remotes_for_url(remote_url)
      if remotes.empty?
        remote = "review_#{repo_owner}"
        git_call("remote add #{remote} #{remote_url}", debug_mode, true)
      else
        remote = remotes.first
      end
      remote
    end
1223392
def _add(self, name, *args, **kwargs):
        ''''''

        self.commands.append(Command(name, args, kwargs))