sparse_checkout: Create a sparse git repository

Description Usage Arguments Details Value Examples

View source: R/sparse_checkout.R

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
sparse_checkout(
  repo_url,
  dest.dir,
  queries,
  vcs = "git",
  create = TRUE,
  append = TRUE,
  remote = "origin",
  branch = "master",
  depth = Inf,
  svn.set.depth = "immediates"
)

Arguments

repo_url

character, repository url path

dest.dir

character, path on local disk that repository is cloned to

queries

character, vector of repository subdirectories to fetch

vcs

character, choose which version control system to checkout files from (git, svn) , Default: 'git'

create

boolean, create a new git clone?, Default: TRUE

append

boolean, append new lines to sparse-checkout file, Default: TRUE

remote

character, alias of the remote Default: 'origin'

branch

character, alias of the branch, Default: 'master'

depth

integer, depth of revisions to checkout, Default: 1

svn.set.depth

character, parameter passed to svn update that controls the depth folders are updated to (see details) Default: 'immediates'

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 http://svnbook.red-bean.com/en/1.7/svn.advanced.sparsedirs.html.

Value

nothing

Examples

1
2
3
4
5
6
7
8
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)

yonicd/vcs documentation built on July 20, 2020, 8:43 a.m.