Skip to content
language21 active rulesVerified 2026-09-30

R .gitignore Template

R history, workspace images, build products, and package checks. Generated and merged deterministically with upstream GitHub repository patterns to keep your repository clean of package directories, temporary build artifacts, and local environment files.

Interactive Stack Generator

Open in Full Generator
Search for templates
Quick add:
Selected1
R
Selected Templates (1)
.gitignore
### R ###
# History files
.Rhistory
.Rapp.history
# Session Data files
.RData
.RDataTmp
# User-specific files
.Ruserdata
# Example code in package build process
*-Ex.R
# Output files from R CMD build
/*.tar.gz
# Output files from R CMD check
/*.Rcheck/
# RStudio files
.Rproj.user/
# produced vignettes
vignettes/*.html
vignettes/*.pdf
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth
# knitr and R markdown default cache directories
*_cache/
/cache/
# Temporary files created by R markdown
*.utf8.md
*.knit.md
# R Environment Variables
.Renviron
.env
# pkgdown site
docs/
# translation temp files
po/*~
# RStudio Connect folder
rsconnect/
21 rules1 template52 lines
Deterministic

Raw R .gitignore

Crawlable upstream source template
r.gitignore51 lines
# History files
.Rhistory
.Rapp.history
# Session Data files
.RData
.RDataTmp
# User-specific files
.Ruserdata
# Example code in package build process
*-Ex.R
# Output files from R CMD build
/*.tar.gz
# Output files from R CMD check
/*.Rcheck/
# RStudio files
.Rproj.user/
# produced vignettes
vignettes/*.html
vignettes/*.pdf
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth
# knitr and R markdown default cache directories
*_cache/
/cache/
# Temporary files created by R markdown
*.utf8.md
*.knit.md
# R Environment Variables
.Renviron
.env
# pkgdown site
docs/
# translation temp files
po/*~
# RStudio Connect folder
rsconnect/

Key Pattern Breakdown

Environment & Secrets

Prevents leaking sensitive local credentials, API keys, database URLs, and environment configuration files.

.httr-oauth.env

Cache & Temporary Files

Ignores compiler caches, test runner coverage data, and transient temporary scratch files.

.RDataTmp*_cache//cache/

Source & Verification

License:: CC0-1.0

Place this file in the root directory of your project as .gitignore. Changes take effect on newly added or untracked files.