## Not run:## Initialize a temporary repositorypath <- tempfile(pattern="git2r-")dir.create(path)repo <- init(path)## Create a user and commit a fileconfig(repo, user.name ="Alice", user.email ="alice@example.org")writeLines("Hello world!", file.path(path,"example.txt"))add(repo,"example.txt")commit(repo,"First commit message")## List branchesbranches(repo)## Check that 'master' is_headmaster <- branches(repo)[[1]]is_head(master)## Create and checkout 'dev' branchcheckout(repo,"dev", create =TRUE)## List branchesbranches(repo)## Check that 'master' is no longer headis_head(master)## End(Not run)