## Not run:## Initialize a temporary repositorypath <- tempfile(pattern="git2r-")dir.create(path)repo <- init(path)# Configure a userconfig(repo, user.name ="Alice", user.email ="alice@example.org")# Create a file, add and commitwriteLines("Hello world!", file.path(path,"test-1.txt"))add(repo,'test-1.txt')commit(repo,"Commit message")# Make one more commitwriteLines(c("Hello world!","HELLO WORLD!"), file.path(path,"test-1.txt"))add(repo,'test-1.txt')commit(repo,"Next commit message")# Create one more filewriteLines("Hello world!", file.path(path,"test-2.txt"))# Check that there are no stashesstash_list(repo)# Stashstash(repo)# Only untracked changes, therefore no stashesstash_list(repo)# Stash and include untracked changesstash(repo,"Stash message", untracked=TRUE)# View stashstash_list(repo)## End(Not run)