add_mirror_repo: Sets up a secondary git remote to push to

View source: R/add_mirror_repo.R

add_mirror_repoR Documentation

Sets up a secondary git remote to push to

Description

This function looks at a current git repository, and sets up tow push remotes, as origin, to push to. First push remote is the original origin and second is a new git repo to push to. The new repo serves as a mirror of the original and is set up as a bare repo. Becuase it is a bare repo you wont be able to browse the files and folders in the mirror location. A clone of this repo will however restore the files and folders at the time of the last push.

Usage

add_mirror_repo(
  mirror_repo = one_drive_mirror(),
  current_repo = ".",
  overwrite_remotes = FALSE
)

Arguments

mirror_repo

The repository that will serve as the mirror. Maybe a GitHub repo URL or a local file path. If a local file path, it must not already exist. Do not use the .git extension

current_repo

The repo you wish to mirror. Default is to use the current folder. It must be a git repository.

Examples

mirror <- normalizePath("C:\\Users\\JHollist\\OneDrive - Environmental Protection Agency (EPA)\\projects\\miscPackage", mustWork = FALSE)
add_mirror_repo(mirror)                     

jhollist/miscPackage documentation built on March 3, 2024, 9:23 p.m.