ghd_copy: Clone Or Download All GitHub Repositories For A User

View source: R/04-copy-repos.R

ghd_copyR Documentation

Clone Or Download All GitHub Repositories For A User

Description

Clone all of a GitHub user's repositories to your computer, or download them all as zip files and then optionally unzip them.

Usage

ghd_copy(gh_user, dest_dir, copy_type, protocol = NULL)

Arguments

gh_user

Character string. A GitHub user name.

dest_dir

Character string. A local file path where the clones or zipped repositories will be downloaded to. Must be a full path.

copy_type

Character string. Specify whether to "download" or "clone" the repos to your local machine.

protocol

Character string. Either "https" or "ssh". Only required if copy_type = "clone".

Details

Make sure you've got a GitHub account and have generated a GitHub PAT and stored it your .Renviron. If you're using protocol = "ssh", you need to make sure you have set up your SSH keys.

Value

GitHub repositories either (a) cloned or (b) downloaded in the specified local directory.

Examples

## Not run: 
ghd_copy(
  gh_user = "matt-dray",
  dest_dir = "~/Documents/repos-cloned",
  copy_type = "clone",
  protocol = "https"
)

ghd_copy(
  gh_user = "matt-dray",
  dest_dir = "~/Documents/repos-downloaded",
  copy_type = "download"
)

## End(Not run)

matt-dray/ghdump documentation built on July 7, 2023, 5:51 p.m.