/
sparse_checkout.Rd
55 lines (45 loc) · 2.1 KB
/
sparse_checkout.Rd
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
52
53
54
55
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparse_checkout.R
\name{sparse_checkout}
\alias{sparse_checkout}
\title{Create a sparse git repository}
\usage{
sparse_checkout(repo_url, dest.dir, queries, vcs = "git", create = TRUE,
append = TRUE, remote = "origin", branch = "master", depth = Inf,
svn.set.depth = "immediates")
}
\arguments{
\item{repo_url}{character, repository url path}
\item{dest.dir}{character, path on local disk that repository is cloned to}
\item{queries}{character, vector of repository subdirectories to fetch}
\item{vcs}{character, choose which version control system to checkout files from (git, svn) , Default: 'git'}
\item{create}{boolean, create a new git clone?, Default: TRUE}
\item{append}{boolean, append new lines to sparse-checkout file, Default: TRUE}
\item{remote}{character, alias of the remote Default: 'origin'}
\item{branch}{character, alias of the branch, Default: 'master'}
\item{depth}{integer, depth of revisions to checkout, Default: 1}
\item{svn.set.depth}{character, parameter passed to svn update that controls the depth folders are updated to (see details) Default: 'immediates'}
}
\value{
nothing
}
\description{
Create a git repository from a version control system that fetches only specified subdirectories and file types,
can be used for github and bitbucket.
}
\details{
Since bitbucket and github are both git version control systems only two options are needed for vcs, passing those values to vcs will default back to git.
The parameters (create,remote, branch,depth) are used only when vcs=='git'. The possible values for svn.set.depth are c('files','immediates','infinity').
For further documentaion see \url{http://svnbook.red-bean.com/en/1.7/svn.advanced.sparsedirs.html}.
}
\examples{
\donttest{
repo_url='https://github.com/tidyverse/ggplot2.git'
dest.dir='ggplot2-sparse'
queries=c('data-raw/*.csv','man/*.Rd')
#create new sparse clone
sparse_checkout(repo_url,dest.dir,queries)
#update sparse-checkout definitions (appends to current list)
sparse_checkout(repo_url,dest.dir,queries=c('man/macros/*.Rd'),create=FALSE,append=TRUE)
}
}