我使用新模板重新搭建了一个博客网站,但是每次打开项目,Rstudio右上角的Git
部分就会显示冗余的改动信息,例如:
.Rproj.user\C1821C3F\pcs\windowlayoutstate.pper
.Rproj.user\C1821C3F\pcs\workbench-pane.pper
搜索到相关文章,里面提到在 .Rproj 文件所在的位置创建一个名为 .gitignore 的文件,然后在该文件中输入一行.Rproj.user/,这可以忽视不重要的信息。
但我的.gitignore文件从创建开始就是以下内容:
.Rproj.user
.Rhistory
.RData
.Ruserdata
可是每次打开,即使没有修改帖子或者主题任何参数,Git
部分都会显示应该被忽略的信息。
我上一个博客模板就没有这种情况,为此,我将上一个博客模板的.gitignore文件的内容复制粘贴到目前使用的博客模板中:
# 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
# pkgdown site
docs/
# translation temp files
po/*~
# RStudio Connect folder
rsconnect/
保存并上传后,发现仍然没有效果,打开项目还是会显示应该被忽略的信息。最后我将正在使用的博客模板的.gitignore文件的原内容改回来了。
我的源代码地址是:https://github.com/residualsun1/MyBlog
请问是应该对.gitignore文件进行修改吗?如果是,应该如何修改?