A signature contains the author and timestamp of a commit. Each commit includes a signature of the author and committer (which can be identical).
git_signature_default(repo = ".")
git_signature(name, email, time = NULL)
git_signature_parse(sig)The path to the git repository. If the directory is not a
repository, parent directories are considered (see git_find). To disable
this search, provide the filepath protected with I(). When using this
parameter, always explicitly call by name (i.e. repo = ) because future
versions of gert may have additional parameters.
Real name of the committer
Email address of the committer
timestamp of class POSIXt or NULL
string in proper "First Last <your@email.com>" format, see details.
A signature string has format "Real Name <email> timestamp tzoffset". The
timestamp tzoffset piece can be omitted in which case the current local
time is used. If not omitted, timestamp must contain the number
of seconds since the Unix epoch and tzoffset is the timezone offset in
hhmm format (note the lack of a colon separator)
Other git:
git_archive,
git_branch(),
git_commit(),
git_config(),
git_diff(),
git_fetch(),
git_ignore,
git_merge(),
git_rebase(),
git_remote,
git_repo,
git_reset(),
git_stash,
git_tag
# Your default user
try(git_signature_default())
#> [1] "Elizabeth Bouton <elizabethb@a2-ai.com>"
# Specify explicit name and email
git_signature("Some committer", "sarah@gmail.com")
#> [git signature]
#> Author: Some committer <sarah@gmail.com>
#> Date: Tue Oct 14 17:29:40 2025 +0000
# Create signature for an hour ago
(sig <- git_signature("Han", "han@company.com", Sys.time() - 3600))
#> [git signature]
#> Author: Han <han@company.com>
#> Date: Tue Oct 14 16:29:40 2025 +0000
# Parse a signature
git_signature_parse(sig)
#> $name
#> [1] "Han"
#>
#> $email
#> [1] "han@company.com"
#>
#> $time
#> [1] "2025-10-14 16:29:40 UTC"
#>
#> $offset
#> [1] 0
#>
git_signature_parse("Emma <emma@mu.edu>")
#> $name
#> [1] "Emma"
#>
#> $email
#> [1] "emma@mu.edu"
#>
#> $time
#> [1] "2025-10-14 17:29:40 UTC"
#>
#> $offset
#> [1] 0
#>