File: commit.Rd

package info (click to toggle)
r-cran-git2r 0.31.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,288 kB
  • sloc: ansic: 8,283; sh: 4,116; makefile: 4
file content (76 lines) | stat: -rw-r--r-- 1,662 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/commit.R
\name{commit}
\alias{commit}
\title{Commit}
\usage{
commit(
  repo = ".",
  message = NULL,
  all = FALSE,
  session = FALSE,
  author = NULL,
  committer = NULL
)
}
\arguments{
\item{repo}{a path to a repository or a \code{git_repository}
object. Default is '.'}

\item{message}{The commit message.}

\item{all}{Stage modified and deleted files. Files not added to
Git are not affected.}

\item{session}{Add sessionInfo to commit message. Default is
FALSE.}

\item{author}{Signature with author and author time of commit.}

\item{committer}{Signature with committer and commit time of
commit.}
}
\value{
A list of class \code{git_commit} with entries:
\describe{
  \item{sha}{
    The 40 character hexadecimal string of the SHA-1
  }
  \item{author}{
    An author signature
  }
  \item{committer}{
    The committer signature
  }
  \item{summary}{
    The short "summary" of a git commit message, comprising the first
    paragraph of the message with whitespace trimmed and squashed.
  }
  \item{message}{
    The message of a commit
  }
  \item{repo}{
    The \code{git_repository} object that contains the commit
  }
}
}
\description{
Commit
}
\examples{
\dontrun{
## 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
lines <- "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do"
writeLines(lines, file.path(path, "example.txt"))
add(repo, "example.txt")
commit(repo, "First commit message")
}
}