discard_changes: Discard local changes to git-watched files

View source: R/discard_changes.R

discard_changesR Documentation

Discard local changes to git-watched files

Description

This will revert local changes for a lesson project folder. Does not currently include files that are not watched (e.g. in assets/ or assembled-lesson-materials/ folders)

Usage

discard_changes(
  gh_proj_name,
  commit_msg = "rolling back with discard_changes()",
  lessons_dir,
  include_untracked = FALSE
)

Arguments

gh_proj_name

The unique project title of this lesson as it is named on https://github.com/galacticpolymath. Not necessarily the same as the ShortTitle used in naming lesson presentations and worksheets; probably more specific with underscores. If left off, will try to get this info from the GitHubURL if available in the front-matter.yml.

commit_msg

string of commit message explaining why you're discarding changes.

lessons_dir

path to the virtualized folder Edu/lessons, where all the lessons are found; default="/Volumes/GoogleDrive/My Drive/Edu/Lessons"

include_untracked

logical; Stash (discard) changes to untracked files? Passed to gert::git_stash_save(). default=FALSE

Value

logical. TRUE if changes succeeded and clear git change list; FALSE if change list not empty.


galacticpolymath/GPpub documentation built on April 5, 2025, 6:04 p.m.