git_HEAD: Get HEAD for a repository

Description Usage Arguments Value Examples

Description

Convenience wrapper around head-methods from git2r.

Usage

1
git_HEAD(repo = ".")

Arguments

repo

Path to a Git repo. If unspecified, current working directory is checked to see if it is or is inside a Git repo.

Value

A list with components:

branch_name

the name and ...

branch_type

type (local vs. remote) of the branch whose tip HEAD currently points to

head_sha

the SHA and ...

head_commit

git_commit object for the specific commit HEAD points to

repo

associated git_repository object

git_branch

associated git_branch object

or NULL if HEAD does not exist.

Examples

1
2
repo <- git_init(tempfile("githug-"))
git_HEAD(repo = repo)

jennybc/githug documentation built on May 19, 2019, 5:05 a.m.