Learn R Programming

ghclass (version 0.1.0)

local_repo_add: Local repository tools

Description

The functions provide tools for working with local git repositories, ghclass includes support for following git commands:

  • git add = local_repo_add

  • git commit = local_repo_commit

  • git push = local_repo_push

  • git pull = local_repo_pull

Usage

local_repo_add(repo_dir, files = ".", git = require_git(),
  options = character(), verbose = FALSE)

local_repo_commit(repo_dir, message, git = require_git(), options = character(), verbose = FALSE)

local_repo_pull(repo_dir, remote = "origin", branch = "master", git = require_git(), options = character(), verbose = FALSE)

local_repo_push(repo_dir, remote = "origin", branch = "master", git = require_git(), options = character(), verbose = FALSE)

Arguments

repo_dir

Vector of repo directories or a single directory containing one or more repos.

files

Files to be staged

git

Path to the local git binary. require_git() attempts to find the git binary based on your `PATH``, it will throw an error if git cannot be found.

options

Additional git binary options (e.g. --all).

verbose

Display verbose output.

message

Commit message

remote

Repository remote to use.

branch

Repository branch to use.

Examples

Run this code
# NOT RUN {
g = org_repos("Sta323-Sp18","hw3-")
local_repo_clone(g, "hw3")

local_repo_pull(g, "hw3")

# After Modifying hw3.Rmd
local_repo_add("hw3", "hw3.Rmd")
local_repo_commit("hw3", "Revised homework")
local_repo_push("hw3")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab