1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/parse-git.R
\name{parse-git-repo}
\alias{parse-git-repo}
\alias{parse_repo_spec}
\alias{parse_github_repo_spec}
\alias{parse_github_url}
\title{Parse a remote git repo specification}
\usage{
parse_repo_spec(repo)
parse_github_repo_spec(repo)
parse_github_url(repo)
}
\arguments{
\item{repo}{Character scalar, the repo specification.}
}
\value{
List with members: \code{username}, \code{repo}, \code{subdir}
\code{ref}, \code{pull}, \code{release}, some which will be empty.
}
\description{
A remote repo can be specified in two ways:
\describe{
\item{as a URL}{\code{parse_github_url()} handles HTTPS and SSH remote URLs
and various GitHub browser URLs}
\item{via a shorthand}{\code{parse_repo_spec()} handles this concise form:
\verb{[username/]repo[/subdir][#pull|@ref|@*release]}}
}
}
\examples{
parse_repo_spec("metacran/crandb")
parse_repo_spec("jimhester/covr#47") ## pull request
parse_repo_spec("jeroen/curl@v0.9.3") ## specific tag
parse_repo_spec("tidyverse/dplyr@*release") ## shorthand for latest release
parse_repo_spec("r-lib/remotes@550a3c7d3f9e1493a2ba") ## commit SHA
parse_repo_spec("igraph=igraph/rigraph") ## Different package name from repo name
parse_github_url("https://github.com/jeroen/curl.git")
parse_github_url("git@github.com:metacran/crandb.git")
parse_github_url("https://github.com/jimhester/covr")
parse_github_url("https://github.example.com/user/repo.git")
parse_github_url("git@github.example.com:user/repo.git")
parse_github_url("https://github.com/r-lib/remotes/pull/108")
parse_github_url("https://github.com/r-lib/remotes/tree/name-of-branch")
parse_github_url("https://github.com/r-lib/remotes/commit/1234567")
parse_github_url("https://github.com/r-lib/remotes/releases/latest")
parse_github_url("https://github.com/r-lib/remotes/releases/tag/1.0.0")
}
|