tree-methods: Tree

Description Usage Arguments Value Examples

Description

Get the tree pointed to by a commit or stash.

Usage

1
2
3
4
5
6
7
tree(object)

## S4 method for signature 'git_commit'
tree(object)

## S4 method for signature 'git_stash'
tree(object)

Arguments

object

the commit or stash object

Value

A S4 class git_tree object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
## Initialize a temporary repository
path <- tempfile(pattern="git2r-")
dir.create(path)
repo <- init(path)

## Create a first user and commit a file
config(repo, user.name="Alice", user.email="[email protected]")
writeLines("Hello world!", file.path(path, "example.txt"))
add(repo, "example.txt")
commit(repo, "First commit message")

tree(commits(repo)[[1]])
summary(tree(commits(repo)[[1]]))

## End(Not run)

git2r documentation built on July 20, 2017, 1:03 a.m.

Related to tree-methods in git2r...