Return the fetch url for the git origin
        :return:
975104
def origin(self):
        
        for item in os.popen('git remote -v'):
            split_item = item.strip().split()
            if split_item[0] == 'origin' and split_item[-1] == '(push)':
                return split_item[1]
1033861
def get_remote(self, remote='origin'):
        """"""
        repo = self.get_repo()
        if repo is not None:
            remotes = {r.name: r for r in repo.remotes}
            r = repo.remotes[0] if remote not in remotes else remotes[remote]
        else:
            r = None
        return r
448855
function getRemoteUrl(repo, remote) {
  return wrapPromise(function (resolve, reject) {
    repo.config(function (err, config) {
      if (err) {
        reject(new Error('Failed to find git repository in ' + config.path))
        return
      }

      resolve(config.items['remote.' + remote + '.url'])
    })
  })
}
800635
def fetch_pull_request_url(repo_slug, build_number, token)
      build_json = fetch_build(repo_slug, build_number, token)
      pull_requests = build_json[:pull_requests]
      return nil unless pull_requests.first
      pull_requests.first[:url]
    end
804880
def get_commit_url(repo_url):
    """"""
    if "github.com" in repo_url:
        return repo_url[:-4] if repo_url.endswith(".git") else repo_url
    if "git.openstack.org" in repo_url:
        uri = '/'.join(repo_url.split('/')[-2:])
        return "https://github.com/{0}".format(uri)

    # If it didn't match these conditions, just return it.
    return repo_url
349087
def get_repo_version(url):
    
    response = requests.get(url)
    if response.status_code == 404:
        return None
    else:
        return response.text.replace('\n', '')
578901
def git_root(self):
        
        if not getattr(self, "_git_folder", None):
            root_folder = os.path.abspath(self.parent_dir)
            while not os.path.exists(os.path.join(root_folder, '.git')):
                if root_folder == '/':
                    raise HarpoonError("Couldn't find a .git folder", start_at=self.parent_dir)
                root_folder = os.path.dirname(root_folder)
            self._git_folder = root_folder
        return self._git_folder
1224751
def get_public_url(self, doc_id, branch='master'):
        
        name, path_frag = self.get_repo_and_path_fragment(doc_id)
        return 'https://raw.githubusercontent.com/OpenTreeOfLife/' + name + '/' + branch + '/' + path_frag
1010751
def fetchref(self, ref):
        """"""
        log.debug('[%s] Fetching ref: %s', self.name, ref)
        fetch_info = self.repo.remotes.origin.fetch(ref).pop()
        return fetch_info.ref
557979
def remote_url(self, remotename='origin'):
        
        cmd = ['git', 'config', 'remote.%s.url' % remotename]
        return self.sh(cmd, shell=False,
                       ignore_error=True).strip()
1236061
def fetch(self, origination_number=values.unset):
        
        params = values.of({'OriginationNumber': origination_number, })

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return NumberInstance(
            self._version,
            payload,
            destination_number=self._solution['destination_number'],
        )
324530
def pull(self, remote="origin", ref=None):
        """"""
        return git_pull(self.repo_dir, remote=remote, ref=ref)
1326247
def get_remote_url(cls, location):
        
        # We need to pass 1 for extra_ok_returncodes since the command
        # exits with return code 1 if there are no matching lines.
        stdout = cls.run_command(
            ['config', '--get-regexp', r'remote\..*\.url'],
            extra_ok_returncodes=(1, ), show_stdout=False, cwd=location,
        )
        remotes = stdout.splitlines()
        try:
            found_remote = remotes[0]
        except IndexError:
            raise RemoteNotFoundError

        for remote in remotes:
            if remote.startswith('remote.origin.url '):
                found_remote = remote
                break
        url = found_remote.split(' ')[1]
        return url.strip()
527662
def get_remote_revision(url, branch):
    
    proc = Process("git remote revision", ["git", "ls-remote", url, "refs/heads/" + branch])

    try:
        while True:
            raw_line = proc.stdout.pop()
            line = raw_line.strip().decode('utf8')
            if not line:
                continue
            return line.split("\t")[0]
    finally:
        try:
            proc.join()
        except Exception:
            pass
312474
def fetch():
    
    mir, r, slackpkg_last_date = mirror(), "", ""
    count, upgraded = 0, []
    if mir:
        tar = urlopen(mir)
        try:
            r = tar.read()
        except AttributeError:
            print("sun: error: can't read mirror")
    if os.path.isfile(var_lib_slackpkg + changelog_txt):
        slackpkg_last_date = read_file("{0}{1}".format(
            var_lib_slackpkg, changelog_txt)).split("\n", 1)[0].strip()
    else:
        return [count, upgraded]
    for line in r.splitlines():
        if slackpkg_last_date == line.strip():
            break
        if (line.endswith("z:  Upgraded.") or line.endswith("z:  Rebuilt.") or
                line.endswith("z:  Added.") or line.endswith("z:  Removed.")):
            upgraded.append(line.split("/")[-1])
            count += 1
        if (line.endswith("*:  Upgraded.") or line.endswith("*:  Rebuilt.") or
                line.endswith("*:  Added.") or line.endswith("*:  Removed.")):
            upgraded.append(line)
            count += 1
    return [count, upgraded]
1357185
def download_repo(repo_url, destination, commit=None):
    '''
    '''
    command = "git clone %s %s" % (repo_url, destination)
    os.system(command)
    return destination
411826
def _pull_branch_from_origin(self):
        
        try:
            ## self.repo.git.pull()
            subprocess.check_call(["git", "pull", "origin", self.branch])
        except Exception as inst:
            sys.exit("""
        Your HEAD commit conflicts with origin/{tag}. 
        Resolve, merge, and rerun versioner.py
        """)