commit {git2r}R Documentation

Commit

Description

Commit

Usage

commit(repo, message = NULL, all = FALSE, session = FALSE,
  reference = "HEAD", author = default_signature(repo),
  committer = default_signature(repo))

## S4 method for signature 'git_repository'
commit(repo, message = NULL, all = FALSE,
  session = FALSE, reference = "HEAD", author = default_signature(repo),
  committer = default_signature(repo))

Arguments

repo

The repository object.

message

The commit message.

all

Stage modified and deleted files. Files not added to Git are not affected.

session

Add sessionInfo to commit message. Default is FALSE.

reference

Name of the reference that will be updated to point to this commit.

author

Signature with author and author time of commit.

committer

Signature with committer and commit time of commit.

Value

git_commit object

Examples

## Not run: 
## Initialize a repository
path <- tempfile(pattern="git2r-")
dir.create(path)
repo <- init(path)

## Config user
config(repo, user.name="Alice", user.email="alice@example.org")

## Write to a file and commit
writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do",
           file.path(path, "example.txt"))
add(repo, "example.txt")
commit(repo, "First commit message")

## End(Not run)

[Package git2r version 0.15.0 Index]