R: Delete an existing tag reference

tag_delete {git2r} | R Documentation

## Delete an existing tag reference

### Description

Delete an existing tag reference

### Usage

    tag_delete(object, ...)

    ## S4 method for signature 'git_repository'
    tag_delete(object, name)

    ## S4 method for signature 'character'
    tag_delete(object)

    ## S4 method for signature 'git_tag'
    tag_delete(object)

### Arguments

`object` | Can be either a (`git_repository`) object, a `git_tag` object or the tag name. If the `object` argument is the tag name, the repository is searched for with `discover_repository` in the current working directory.
`...` | Additional arguments
`name` | If the `object` argument is a `git_repository`, the name of the tag to delete.

### Value

`invisible(NULL)`

### Examples

    ## Not run:
    ## 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
    writeLines("Hello world!", file.path(path, "example.txt"))
    add(repo, "example.txt")
    commit(repo, "First commit message")

    ## Create two tags
    tag(repo, "Tag1", "Tag message 1")
    t2 <- tag(repo, "Tag2", "Tag message 2")

    ## List the two tags in the repository
    tags(repo)

    ## Delete the two tags in the repository
    tag_delete(repo, "Tag1")
    tag_delete(t2)

    ## Show the empty list with tags in the repository
    tags(repo)

    ## End(Not run)

[Package git2r version 0.21.0 Index]