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
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tag.R
\name{tag}
\alias{tag}
\title{Create tag targeting HEAD commit in repository}
\usage{
tag(
object = ".",
name = NULL,
message = NULL,
session = FALSE,
tagger = NULL,
force = FALSE
)
}
\arguments{
\item{object}{The repository \code{object}.}
\item{name}{Name for the tag.}
\item{message}{The tag message. Specify a tag message to create an
annotated tag. A lightweight tag is created if the message
parameter is \code{NULL}.}
\item{session}{Add sessionInfo to tag message. Default is FALSE.}
\item{tagger}{The tagger (author) of the tag}
\item{force}{Overwrite existing tag. Default = FALSE}
}
\value{
invisible(\code{git_tag}) object
}
\description{
Create tag targeting HEAD commit in repository
}
\examples{
\dontrun{
## Initialize a temporary repository
path <- tempfile(pattern="git2r-")
dir.create(path)
repo <- init(path)
## Create a user
config(repo, user.name = "Alice", user.email = "alice@example.org")
## Commit a text file
filename <- file.path(path, "example.txt")
writeLines("Hello world!", filename)
add(repo, "example.txt")
commit(repo, "First commit message")
## Create an annotated tag
tag(repo, "v1.0", "Tag message")
## List tags
tags(repo)
## Make a change to the text file and commit.
writeLines(c("Hello world!", "HELLO WORLD!"), filename)
add(repo, "example.txt")
commit(repo, "Second commit message")
## Create a lightweight tag
tag(repo, "v2.0")
## List tags
tags(repo)
}
}
|