# Create a temporary directory for testing
tmp_dir <- tempdir()
# Write a minimal .gitignore file (default)
write_ignore(path = tmp_dir)
# Clean up the first file before creating the next one
unlink(file.path(tmp_dir, ".gitignore"))
# Write an aggressive .gitignore file
write_ignore(path = tmp_dir, aggressive = TRUE)
# Clean up
unlink(file.path(tmp_dir, ".gitignore"))
Run the code above in your browser using DataLab