26 Commits
Author SHA1 Message Date
Russell Shean 460b9d97a7 R: add .env to prevent accidentally exposing credentials
Historically R users have used the .Renviron file for storing environmental variables such as secrets, credentials, API keys etc. However, I believe there are several compelling reasons for adding .env to the .gitignore too:

1. The dotenv R package was created to allow users to use .env instead of .Renviron. The package has a significant number of downloads.  https://github.com/gaborcsardi/dotenv 

2. .env files are standard in many other programming languages. It wouldn't be that out of the unexpected to think R users might end up with an .env file because a python user on their team contributed files to the repo, the R user started programming in nodejs and is used to working with .env file, or a repo is in the process of being translated from a language that uses .env to R. 

3. LLMs are making programming accessible to people who may not have much previous experience handling credentials and security. One of the first steps many of these users have to do is store LLM provider API keys somewhere. I worry about a new R user adapting a python workflow or an R workflow that recommends using an .env file and then accidentally committing their LLM API keys to a public repo. 

4. I can't think of why an R user would create an .env file for any other reason other than storing credentials and environmental variables. If, for whatever reason, they need to commit an .env file, they can remove that part from the template, but I think the risk of accidentally exposing sensitive credentials justifies adding .env files to the template and not commenting it out by default.
2025-12-19 19:27:15 +08:00
Brian Douglas cfdda2ac19 Merge pull request #3792 from jl5000/patch-1
Add RStudio Connect folder to R gitignore
2021-12-10 16:11:17 -08:00
LeixB 1559f2ee6b Add .RDataTmp to R.gitignore
When saving `.RData`, all data is initially saved in `.RDataTmp` which
is then renamed to `.RData`.

`.RDataTmp` should be added to `.gitignore` since it will only exist
while a save operation is in progress or something failed on save.

Relevant links:
- https://stackoverflow.com/questions/32098036/purpose-of-rdatatmp-temporary-file-r
- https://github.com/wch/r-source/blob/trunk/src/library/base/R/load.R#L145-L154
2021-11-29 17:26:20 +01:00
Jamie Lendrum b2fae2dd0f Add RStudio Connect folder to R gitignore
https://community.rstudio.com/t/should-i-include-the-rsconnect-folder-to-gitignore/98237
2021-07-22 12:05:41 +01:00
Michael Chirico 5cf393421d ignore *~ files in the po directory (#3453)
Common IME for `gettext` utilities like `tools::update_pkg_po('.')` to create these temp files (at least on Mac)
2020-07-03 17:19:48 -03:00
Patrick Schratz 3df9bc0bd9 Update R.gitignore (#3354) 2020-03-28 11:47:35 -03:00
raybuhr e5b26f5c9b exclude .Renviron (#3214) 2019-11-08 17:11:59 -04:00
zy26 26f49b0c26 Update R.gitignore (#3034)
ignore knitr and R markdown default cache directories in subdirectories
2019-04-22 08:56:28 -03:00
kaasasolut 210a49a70a R: ignore user-specific files 2019-02-25 10:17:59 +01:00
Cole Arendt 9771d5c8d1 remove rsconnect folder from R.gitignore 2018-11-27 14:33:43 -05:00
dgabbe 82caf7ce67 Exclude secret deployment key in rsconnect/
Exclude secret deployment key in rsconnect/, see https://shiny.rstudio.com/articles/shinyapps.html for details.
2018-02-12 11:47:41 -05:00
jrnold 4956277b1a Add knitr and R markdown patterns to R.gitignore
These patterns handle cache diretories and temporary files created
by the widely used [knitr](http://yihui.name/knitr/) and [R markdown](http://rmarkdown.rstudio.com/)
packages.
2016-04-29 07:17:44 -07:00
Brendan Forster 4596d11577 Merge pull request #1684 from jimhester/patch-1
Ignore output from R CMD build and R CMD check
2016-03-06 19:13:35 +11:00
Jim Hester 09a78cc2bd Ignore .RData files
N.B. this ignores only the exact file `.RData` generated by default from `save.image()` and `quit()`.  It is _not_ what is referred to in https://github.com/github/gitignore/commit/1f8466164330277fc8c9126ded3cc207ff3baf91 and http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages, which refers only to files with an `*.RData` _extension_.
2015-10-02 08:50:47 -04:00
Jim Hester 7830ef7b59 Ignore output from R CMD build and R CMD check
Both rules are restricted to the top level only, so `*.tar.gz` files in data directories for instance will _not_ be ignored.
2015-10-02 08:45:11 -04:00
Katrin Leinweber fbe660091e ignore OAuth2 token
Created for example when using https://github.com/jennybc/googlesheets
2015-05-20 17:12:32 +02:00
Carl Suster b584eee4d6 Merge pull request #1263 from jangorecki/master
R.gitignore - exclude vignettes products
2014-11-29 15:38:28 +11:00
Adam Liter 60ff5ad75a Add history file that is generated by R.app for Mac OS 2014-11-27 18:39:00 -06:00
jangorecki 9010a3a58a exclude vignettes products 2014-10-25 12:28:19 +02:00
Gergely Daróczi ab7b6dba4a revert 1f84661643
Details: `RData` is a valid file format for bundling data with an R
package based on the "Writing R Extensions" manual:
http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages
2014-10-13 00:25:41 +02:00
Oliver Keyes 80c9cc5e7c Change to directory 2014-09-02 04:14:55 -04:00
Oliver Keyes a40aa51f90 Small fix
.Rproj is fine - it's .Rproj.user that needs to go.
2014-09-01 12:00:20 -04:00
Oliver Keyes be40677028 Add *.Rproj for RStudio users
RStudio - the only real R IDE, and an incredibly commonly used environment for R, particularly since it has git support - uses .Rproj files in projects, that follow the pattern projectname.Rproj. Adding *.Rproj to capture these and exclude them.
2014-08-25 16:08:38 -04:00
Tim Grilley 1f84661643 R.gitignore - Added .Rdata files 2014-02-27 06:45:11 -06:00
Ivan Zuzak f0dde55c6b ensure single trailing newline 2013-10-06 14:40:01 +02:00
Julian Gehring bf8796aece add 'R.gitignore' for R 2011-10-08 09:23:47 +02:00