You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have started to work on this and added commits methods with signature git_commit, git_branch and git_tag in the fr_commits branch. Is this the functionality you meant?
library(git2r)
## Create a directory in tempdirpath<- tempfile(pattern="git2r-")
dir.create(path)
## Initialize a repositoryrepo<- init(path)
config(repo, user.name="Alice", user.email="[email protected]")
## Create a file and commit
writeLines("Hello world!", file.path(path, "test.txt"))
add(repo, "test.txt")
commit_1<- commit(repo, "First commit message")
## Update the file and commit
writeLines(c("Hello world!", "Hello world!"), file.path(path, "test.txt"))
add(repo, "test.txt")
commit_2<- commit(repo, "Second commit message")
## Add a tagtag_1<- tag(repo, "Tagname", "Tag message")
## List commits
commits(repo)
#> [[1]]#> [f520221] 2016-05-18: Second commit message#> #> [[2]]#> [25d02cb] 2016-05-18: First commit message
commits(commit_1)
#> [[1]]#> [f520221] 2016-05-18: Second commit message#> #> [[2]]#> [25d02cb] 2016-05-18: First commit message
commits(commit_2)
#> [[1]]#> [f520221] 2016-05-18: Second commit message#> #> [[2]]#> [25d02cb] 2016-05-18: First commit message
commits(tag_1)
#> [[1]]#> [f520221] 2016-05-18: Second commit message#> #> [[2]]#> [25d02cb] 2016-05-18: First commit message
commits(branches(repo)$master)
#> [[1]]#> [f520221] 2016-05-18: Second commit message#> #> [[2]]#> [25d02cb] 2016-05-18: First commit message
The text was updated successfully, but these errors were encountered: