reflog {git2r} | R Documentation

## List and view reflog information

### Description

List and view reflog information

### Usage

    reflog(repo, refname)

    ## S4 method for signature 'git_repository,missing'
    reflog(repo)

    ## S4 method for signature 'git_repository,character'
    reflog(repo, refname)

### Arguments

`repo` | S4 class git_repository `object`.
`refname` | The name of the reference to list. 'HEAD' by default.

### Value

S3 class `git_reflog` with git_reflog_entry objects.

### 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")

    ## Change file and commit
    writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do",
                 "eiusmod tempor incididunt ut labore et dolore magna aliqua."),
               file.path(path, "example.txt"))
    add(repo, "example.txt")
    commit(repo, "Second commit message")

    ## Change file again and commit
    writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do",
                 "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad",
                 "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"),
               file.path(path, "example.txt"))
    add(repo, "example.txt")
    commit(repo, "Third commit message")

    ## View reflog
    reflog(repo)

    ## End(Not run)

[Package git2r version 0.20.0 Index]