Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New fusen projects with git should have a complete .gitignore file #171

Closed
ALanguillaume opened this issue Nov 8, 2022 · 0 comments · Fixed by #215
Closed

New fusen projects with git should have a complete .gitignore file #171

ALanguillaume opened this issue Nov 8, 2022 · 0 comments · Fixed by #215
Assignees

Comments

@ALanguillaume
Copy link
Contributor

Problem Statement

Currently if you create a new fusen project with the Rstudio GUI,

Only .Rproj.user is added to the project .gitignore

#> ── Creating new directory: /tmp/RtmpAx5OwZ/foo7f9d85c783b ────────────
#> ✔ Creating '/tmp/RtmpAx5OwZ/foo7f9d85c783b/'
#> ✔ Setting active project to '/tmp/RtmpAx5OwZ/foo7f9d85c783b'
#> ✔ Creating 'R/'
#> ✔ Writing 'foo7f9d85c783b.Rproj'
#> ✔ Adding '.Rproj.user' to '.gitignore'
#> ✔ Setting active project to '<no active project>'
#> ✔ New directory created: /tmp/RtmpAx5OwZ/foo7f9d85c783b
#> ── Initializing git repository ───────────────────────────────────────
#> ✔ Initialized git repository
#> ── Adding dev/flat_minimal.Rmd ───────────────────────────────────────
#> ✔ Added /tmp/RtmpAx5OwZ/foo7f9d85c783b/dev/flat_minimal.Rmd, /tmp/RtmpAx5OwZ/foo7f9d85c783b/dev/0-dev_history.Rmd

If your system is not git_vaccinate()ed you are at risk of committing your .Rhistory file. This is something we should avoid while teaching.

Proposed solution

Add .Rhistory and .Rdata in the .gitignore file that is created anyway with the rstudio project.

Here:

usethis::create_project(path, open = FALSE)

## Initialize Rstudio project or create directory
cli::cat_rule(paste0("Creating new directory: ", path))
usethis::create_project(path, open = FALSE)
usethis::use_git_ignore(c(".Rhistory", ".Rdata"))
cli::cli_alert_success(paste0("New directory created: ", path))
@statnmap statnmap self-assigned this Jun 13, 2023
statnmap added a commit that referenced this issue Jun 13, 2023
tags: feat, test

- ignore important file from the beginning of the project

issue closes #171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants