Skip to contents

This function creates or updates a .gitignore file with enhanced security measures designed to help prevent accidental data leaks. The template includes comprehensive rules for common data file types and sensitive information.

Usage

write_ignore(path = getwd())

Arguments

path

The path to the main project level. Defaults to the current working directory.

Value

A .gitignore file with enhanced security rules. The file includes:
* R data files (.RData, .rda, .rds)
* Common data formats (CSV, Excel, text)
* System and temporary files
* IDE-specific files

Details

If a .gitignore file already exists, the user will be prompted before any overwriting occurs. The template provides substantial security enhancements over basic .gitignore files.

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.

Examples

if (FALSE) { # \dontrun{
# Create a new temporary directory for the example
temp_dir <- tempdir()

# Create new .gitignore
write_ignore(path = temp_dir)
} # }