Learn R Programming

froggeR (version 0.6.0)

write_ignore: Create an Enhanced .gitignore File

Description

This function creates a .gitignore file with either a minimal or aggressive set of ignore rules and opens it for editing.

Usage

write_ignore(path = here::here(), aggressive = FALSE)

Value

Invisibly returns the path to the created file.

Arguments

path

Character. Path to the project directory. Default is current project root via here.

aggressive

Logical. If TRUE, creates a comprehensive .gitignore with aggressive rules for sensitive data. If FALSE (default), creates a minimal .gitignore suitable for most R projects.

Details

The aggressive = TRUE template includes comprehensive rules for common data file types and sensitive information.

WARNING: Always consult your organization's data security team before using git with any sensitive or protected health information (PHI). This template helps prevent accidental data exposure but should not be considered a complete security solution.

See Also

quarto_project, write_quarto

Examples

Run this code
# 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